Example #1
0
        public void JsonDeserialization()
        {
            string    jsonData  = @"{
                                 'Name': 'Sam',
                                 'Description' :'Welcome to Universe'
                                }";
            BlogSites blogSites = JsonConvert.DeserializeObject <BlogSites>(jsonData);

            Console.WriteLine(blogSites.Name);
            Console.WriteLine(blogSites.Description);
        }
Example #2
0
        public void JsonSerialization()
        {
            BlogSites blogSites = new BlogSites()
            {
                Name        = "Sam",
                Description = "Welcome to Universe"
            };
            string jsonData = JsonConvert.SerializeObject(blogSites);

            Console.WriteLine(jsonData);
        }