Skip to main content

Posts

Showing posts from February, 2021

JSON Serialization & Deserialization in c#

 Serialization: Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. JSON Serialization: JSON serialization serializes the public properties of an object into a string, byte array, or stream.  public static string SerializeObject(object obj)         {             string jsonString = null;             DataContractJsonSerializer serializer = null;             MemoryStream memorystream = null;             try             {                 serializer = new DataContractJsonSerializer(obj.GetType());                 memorystream = new MemoryStream();                 serializer.WriteObject(memorystream, obj);...