Click here to Skip to main content
11,928,987 members (54,700 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked

REST with WCF and Entity Framework with JSON Serialization

, 1 May 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
This is an alternative for "REST with WCF and Entity Framework with JSON Serialization"

Note : This is an alternate solution for  This Article.

Alternate Solution for JSON Serialization

You can use Json.NET library to serialize Entity FrameWork object. It is fast and more effective then given solution. JavascriptSerialization but it is taking more time then Json.NET.

You can find source code from :

Simple Example  

 using (FrameworkContainer fc = new FrameworkContainer()) //Entity Framework Object
                var realObject = fc.GetAccountInformation("AmitGajjar"); // Calling Entity Framework Function (SP)

                using (MemoryStream ms = new MemoryStream())
                    var result = from account in realObject
                                 select new
                                     Name = account.Account_Name,
                                     City = account.Address1_City,
                                     Phone = account.Address1_Telephone
// serializedObject will be json object from entity
                    var serializedObject = JsonConvert.SerializeObject(result);

Hope this will help you to implement serialization very quickly.  


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
India India
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151126.1 | Last Updated 2 May 2013
Article Copyright 2013 by @AmitGajjar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid