Thursday 19 November 2015

Json Deserilize Model Binding Async,Await

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);
        }


1 comment:

  1. it is very excellent blog and useful article thank you for sharing with us , keep posting AngularJS Online Course India

    ReplyDelete