public string Binding() { GridRequestParameters param = GridRequestParameters.Current; List <Context.Location> items = RepoLocation.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters); List <Location> ListModel = new List <Location>(); foreach (Context.Location item in items) { ListModel.Add(new Location(item)); } int total = RepoLocation.Count(param.Filters); return(new JavaScriptSerializer().Serialize(new { total = total, data = ListModel })); }