Exemple #1
0
        // Đếm tổng số lượng Category
        public int Count(UserEntity UserEntity, SearchCategoryEntity SearchCategoryEntity)
        {
            if (SearchCategoryEntity == null)
            {
                SearchCategoryEntity = new SearchCategoryEntity();
            }
            IQueryable <Category> Categories = CinemasEntities.Categories;

            Categories = SearchCategoryEntity.ApplyTo(Categories);
            return(Categories.Count());
        }
Exemple #2
0
        // Lấy các Category theo điều kiện search
        public List <CategoryEntity> Gets(UserEntity UserEntity, SearchCategoryEntity SearchCategoryEntity)
        {
            if (SearchCategoryEntity == null)
            {
                SearchCategoryEntity = new SearchCategoryEntity();
            }
            IQueryable <Category> Categories = CinemasEntities.Categories;

            Categories = SearchCategoryEntity.ApplyTo(Categories);
            Categories = SearchCategoryEntity.SkipAndTake(Categories);
            return(Categories.ToList().Select(c => new CategoryEntity(c)).ToList());
        }
Exemple #3
0
 public List <CategoryEntity> Gets([FromUri] SearchCategoryEntity SearchCategoryEntity)
 {
     return(CategoryService.Gets(UserEntity, SearchCategoryEntity));
 }
Exemple #4
0
 public int Count([FromUri] SearchCategoryEntity SearchCategoryEntity)
 {
     return(CategoryService.Count(UserEntity, SearchCategoryEntity));
 }