Can you please explain why we serializing the json object and how we can store serialized object(string) in the database. Lets suppose we have table of user. I create a post API that creates a user and store in a database how can I use serialization here and what will be the benefit of doing it?
@CodewithRSV9 ай бұрын
Ideally you shouldn't use json string to store your object in db. using entity framework is much better for that. json serialization is better suited for data transfer between API or apps.
@abdulrafay24209 ай бұрын
@@CodewithRSV Got it...thanks
@abdulrafay24209 ай бұрын
@@CodewithRSV Got it...thanks
@abubakarizhar56085 ай бұрын
I can not add System.Text.jso in my VS 2017. Please guide.
@CodewithRSV5 ай бұрын
@@abubakarizhar5608 what is the target framework of your project?
@abubakarizhar56085 ай бұрын
@@CodewithRSV .NET 4.8
@abinayaabi213410 ай бұрын
thank you so much
@abhishekbhawankar29716 ай бұрын
Can we create deserialisation in MVC core
@CodewithRSV6 ай бұрын
@@abhishekbhawankar2971 yes
@peremos778110 ай бұрын
How do I deserialize my json when it has a word "producto" before properties? { "producto": { "iDpRODUCTO": 6, "codigoBarra": 54323, "nombre": "cera", "marca": "avon", "categoria": "belleza", "precio": 3400 } }
@CodewithRSV10 ай бұрын
Try to de-serialize to Root class: // Root myDeserializedClass = JsonConvert.DeserializeObject(myJsonResponse); public class Root { public Producto producto { get; set; } } public class Producto { public int iDpRODUCTO { get; set; } public int codigoBarra { get; set; } public string nombre { get; set; } public string marca { get; set; } public string categoria { get; set; } public int precio { get; set; } }
@peremos778110 ай бұрын
@@CodewithRSV thanks, I am using System.Text.Json, can it be done the same?