Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
        public List <CategorysDto> GetCategorysPageListBy(CategorysInput categorysInput)
        {
            var result = GetCategorysByCondition(categorysInput).OrderBy(o => o.SortNo).ToList();

            return(result);
        }
Exemplo n.º 3
0
        public CategorysDto GetCategorysBy(CategorysInput categorysInput)
        {
            var t = GetCategorysByCondition(categorysInput).FirstOrDefault();

            return(t);
        }