public static IQueryable <IDsdSet> GetPlistDsdSets(this IAcDomain acDomain, GetPlistResult requestModel) { EntityTypeState roleEntityType = acDomain.GetEntityType(new Coder("Ac", "DsdSet")); foreach (var filter in requestModel.Filters) { PropertyState property; if (!roleEntityType.TryGetProperty(filter.field, out property)) { throw new ValidationException("意外的DsdSet实体类型属性" + filter.field); } } int pageIndex = requestModel.PageIndex; int pageSize = requestModel.PageSize; var queryable = acDomain.DsdSetSet.AsQueryable(); foreach (var filter in requestModel.Filters) { queryable = queryable.Where(filter.ToPredicate(), filter.value); } requestModel.Total = queryable.Count(); return(queryable.OrderBy(requestModel.SortField + " " + requestModel.SortOrder).Skip(pageIndex * pageSize).Take(pageSize)); }
public static IQueryable <UiViewTr> GetPlistUiViews(this IAcDomain acDomain, GetPlistResult requestData) { EntityTypeState viewEntityType = acDomain.GetEntityType(new Coder("Ac", "UIView")); foreach (var filter in requestData.Filters) { PropertyState property; if (!viewEntityType.TryGetProperty(filter.field, out property)) { throw new ValidationException("意外的UIView实体类型属性" + filter.field); } } int pageIndex = requestData.PageIndex; int pageSize = requestData.PageSize; var queryable = acDomain.UiViewSet.Select(UiViewTr.Create).AsQueryable(); foreach (var filter in requestData.Filters) { queryable = queryable.Where(filter.ToPredicate(), filter.value); } requestData.Total = queryable.Count(); return(queryable.OrderBy(requestData.SortField + " " + requestData.SortOrder).Skip(pageIndex * pageSize).Take(pageSize)); }