Check out example codes for "c# serialize". It will help you in understanding the concepts better.

Code Example 1

Tutorial obj = new Tutorial();
    obj.ID = 1;
    obj.Name = ".Net";

    IFormatter formatter = new BinaryFormatter();
    Stream stream = new FileStream(@"E:\ExampleNew.txt",FileMode.Create,FileAccess.Write);

    formatter.Serialize(stream, obj);
    stream.Close();

Learn ReactJs, React Native from akashmittal.com