Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Newtonsoft.Json;
- namespace Serialization
- {
- class Program
- {
- static void Main(string[] args)
- {
- Students student = new Students();
- student.FirstName = "Roma";
- student.LastName = "Makushenko";
- string item = JsonConvert.SerializeObject(student);
- Students stud = JsonConvert.DeserializeObject<Students>(item);
- Console.WriteLine(stud.FirstName +" "+ stud.LastName);
- }
- }
- class Students
- {
- public string FirstName { get; set; }
- public string LastName { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement