Building a ToJSON() Extension Method using .NET 3.5


Here…Serialize a List<Person> into a string of JSON format

image

Here is the Extension method to provide the JSON serialization on the String Type.

image

Note: In addition to the JavaScriptSerializer class, .NET 3.5 also now includes a new System.Runtime.Serialization.DataContractJsonSerializer class that you can use for JSON serialization/deserialization

Via Tip/Trick: Building a ToJSON() Extension Method using .NET 3.5 – ScottGu’s Blog

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s