If we get JsonValue package from nuget in VS2010, then the application will have a reference to Microsoft.Json.dll that will provide System.Json.JsonValue datatype. JsonValue is the abstarct base class and the JSON CLR types JsonPrimitive, JsonArray, and JsonObject all inherit from this base class.
this is very useful when we need to create or parse json data.
Here is an example how to use it.
This method will grab all catalog entites from database using entity framework code first and then it will return only two properties of those entities as json data.
public System.Json.JsonValue GetCatalogs() { DbContext context = new MyContext(); DbSet<T> dbSet = context.Set<Catalog>(); var list = dbSet.Select(s => new { s.CatalogId, s.CatName }).ToList(); var results = new System.Json.JsonArray(); foreach (var item in list) { dynamic obj = new System.Json.JsonObject(); obj.CatalogId = item.CatalogId; obj.CatName = item.CatalogId; results.Add(obj); } return results; }
2 comments:
Your Affiliate Profit Machine is ready -
Plus, making money with it is as simple as 1--2--3!
Here are the steps to make it work...
STEP 1. Choose affiliate products you intend to promote
STEP 2. Add some push button traffic (it ONLY takes 2 minutes)
STEP 3. See how the system explode your list and sell your affiliate products all on it's own!
Are you ready to make money ONLINE??
Your MONEY MAKING affiliate solution is RIGHT HERE
After Fut Hair Transplantation So good page
Post a Comment