Tuesday, July 15, 2014

Json.Net

Adding Json string to sql.

Model
[{"LocationId":152,"BranchCode":"21","SourceSystem":"RSSSP"}]
List
[{"LocationId":152,"BranchCode":"21","SourceSystem":"RSSSP"},{"LocationId":156,"BranchCode":"17","SourceSystem":"RSSSP"}]


.Net
using Newtonsoft.Json;

Create exact model
List<Model> objs = JsonConvert.DeserializeObject<List<Model>>(string);

Ref
http://james.newtonking.com/json

No comments:

Post a Comment