private IEnumerable <CategorysDto> GetCategorysByCondition(CategorysInput categorysInput) { return(GetAllCategorys() .WhereIf(categorysInput.CategoryType.IsNotNullAndNotEmpty(), o => o.CategoryType == categorysInput.CategoryType) .WhereIf(categorysInput.DictionaryValue.IsNotNullAndNotEmpty(), o => o.DictionaryValue == categorysInput.DictionaryValue) .WhereIf(categorysInput.Level.HasValue, o => o.Level == categorysInput.Level) .WhereIf(categorysInput.ParentId.IsNotNullAndNotEmpty(), o => o.ParentId == categorysInput.ParentId) .WhereIf(categorysInput.SysDefined.HasValue, o => o.SysDefined == categorysInput.SysDefined) .WhereIf(categorysInput.CategoryName.IsNotNullAndNotEmpty(), o => o.CategoryName == categorysInput.CategoryName)); }
public List <CategorysDto> GetCategorysPageListBy(CategorysInput categorysInput) { var result = GetCategorysByCondition(categorysInput).OrderBy(o => o.SortNo).ToList(); return(result); }
public CategorysDto GetCategorysBy(CategorysInput categorysInput) { var t = GetCategorysByCondition(categorysInput).FirstOrDefault(); return(t); }