Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

parse json C#


Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Price = 3.99M;
product.Sizes = new string[] { "Small", "Medium", "Large" };

string json = JsonConvert.SerializeObject(product);
//{
//  "Name": "Apple",
//  "Expiry": "2008-12-28T00:00:00",
//  "Price": 3.99,
//  "Sizes": [
//    "Small",
//    "Medium",
//    "Large"
//  ]
//}

Product deserializedProduct = JsonConvert.DeserializeObject<Product>(json);

Comment

PREVIOUS NEXT
Code Example
Javascript :: js default parameter 
Javascript :: javascript function from string 
Javascript :: javascript remove uniques from array 
Javascript :: count using sequelize.fn 
Javascript :: jquery get position of element 
Javascript :: why to use event.persist 
Javascript :: react native flexbox 2 columns 1 fixed width 
Javascript :: python convert json to csv 
Javascript :: storage package npm react 
Javascript :: express session mongoose 
Javascript :: async function js 
Javascript :: how to check if a string is an integer javascript 
Javascript :: encryptedfields mongoose-encrypt 
Javascript :: express octet stream 
Javascript :: Get size of a View in React Native 
Javascript :: javascript map 
Javascript :: onpress setstate react native 
Javascript :: exploding string with comma using jquery 
Javascript :: jquery class selector 
Javascript :: foreach loop in nodejs 
Javascript :: explain the exclamation mark in js 
Javascript :: npm request 
Javascript :: fizzbuzz javascript 
Javascript :: 1 dollar in rupees 
Javascript :: window resize done 
Javascript :: axios forward 
Javascript :: removes null and false values from an array 
Javascript :: js read external json file js 
Javascript :: react got error need to enable javascript 
Javascript :: javascript static variable in class 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =