public DataSourceResult Get(Kendo.DynamicLinq.View filters) { DataSourceResult result = _userRepository.Get(filters); List <User> users = (List <User>)result.Data; List <UserView> usersView = new List <UserView>(); foreach (User user in users) { usersView.Add(UserToUserView(user)); } result.Data = usersView; return(result); }
public DataSourceResult Get(Kendo.DynamicLinq.View filters) { Kendo.DynamicLinq.Filter Filter = null; if (filters.Filter != null) { Filter = filters.FieldTypeCheckAll(filters.Filter); } if (Filter != null) { filters.Filter = Filter; } //List<Models.Domain.User> result = new List<User>(); DataSourceResult result = _identityDatabaseContext.Set <Models.Domain.User>() .OrderBy(p => p.CreateDate) // EF requires ordering for paging .ToDataSourceResult(filters.Take, filters.Skip, filters.Sort, filters.Filter, filters.Aggregates); return(result); }
public List <Models.Domain.Product> Get(Kendo.DynamicLinq.View filters) { Filter Filter = null; if (filters.Filter != null) { Filter = filters.FieldTypeCheckAll(filters.Filter); } if (Filter != null) { filters.Filter = Filter; } List <Models.Domain.Product> result = (List <Models.Domain.Product>)_productDatabaseContext.Set <Models.Domain.Product>() .OrderBy(p => p.Id) // EF requires ordering for paging .ToDataSourceResult(filters.Take, filters.Skip, filters.Sort, filters.Filter, filters.Aggregates).Data; return(result); }
public async Task <CommonApiResponse <List <ProductView> > > Post([FromBody] Kendo.DynamicLinq.View filters) { List <ProductView> result = _productService.GetProductViewList(Guid.Parse("00000000-0000-0000-0000-000000000000"), filters); return(CommonApiResponse <List <ProductView> > .Create(Response, System.Net.HttpStatusCode.OK, true, result, "")); }