Json Deserilize Model Binding Async,Await
Sample Code is here :
public async Task<List<Models.Emp>> DemoAsyn()
{
var obj = await new WebClient().DownloadStringTaskAsync("http://api.androidhive.info/contacts/");
string str = obj.Split('[').GetValue(1).ToString().Split(']').GetValue(0).ToString();
List<Models.Emp> list = JsonConvert.DeserializeObject<List<Models.Emp>>("[" + str + "]");
return View(list);
}
Sample Code is here :
public async Task<List<Models.Emp>> DemoAsyn()
{
var obj = await new WebClient().DownloadStringTaskAsync("http://api.androidhive.info/contacts/");
string str = obj.Split('[').GetValue(1).ToString().Split(']').GetValue(0).ToString();
List<Models.Emp> list = JsonConvert.DeserializeObject<List<Models.Emp>>("[" + str + "]");
return View(list);
}
it is very excellent blog and useful article thank you for sharing with us , keep posting AngularJS Online Course India
ReplyDelete