My controller is returning Json result of List
Public ActionResult Index([DataSourceRequest] DataSourceRequest request)
{
var list = new List<Product>();
Json(list.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
Below is the code of my Unit Test method,in which i am calling above method:
//Act
var actualResult = _Controller.Index(request) as JsonResult;
var data = actualResult.Data;
And now i want to covert this data object to its original type means List.
I tried like below :-
var result = ser.Deserialize<List<Product>>(ser.Serialize(actualResult.Data));
But i am not getting my original data by this.Can anyone help me out,how we can covert jsonresult.data output to its original type ?
>(data)`
– Yuval Itzchakov Jun 21 '14 at 11:33