Advertisement
aslen

Untitled

May 19th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Newtonsoft.Json;
  7.  
  8. namespace Serialization
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Students student = new Students();
  15.             student.FirstName = "Roma";
  16.             student.LastName = "Makushenko";
  17.             string item = JsonConvert.SerializeObject(student);
  18.  
  19.             JsonConvert.DeserializeObject<Students>(item);
  20.         }
  21.     }
  22.     class Students
  23.     {
  24.         public string FirstName { get; set; }
  25.         public string LastName { get; set; }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement