コード例 #1
0
        public async Task <ActionResult <Category> > GetCategoryById(int id)
        {
            var category = await _categoryDal.GetById(id);

            if (category == null)
            {
                return(NotFound());
            }

            return(Ok(category));
        }
コード例 #2
0
        public IResult DeleteCorrect(int id)
        {
            var category = _categoryDal.GetById(id);

            if (category.ArticleCategories == null || category.ArticleCategories.Count == 0)
            {
                _categoryDal.Delete(category);
                return(new SuccessResult(Messages.SUCCESS_DELETE));
            }
            return(new ErrorResult(Messages.ERROR_DELETE_HAVE_ARTICLE));
        }
コード例 #3
0
 public IDataResult <List <Category> > GetById(int categoryId)
 {
     return(new SuccessDataResult <List <Category> >(_categoryDal.GetById(c => c.CategoryId == categoryId)));
 }
コード例 #4
0
 public Category GetById(int id)
 {
     return(_categoryDal.GetById(id));
 }
コード例 #5
0
 //Select * from Categories where CategoryId=3
 Category ICategoryService.GetById(int categoryId)
 {
     return(_categoryDal.GetById(c => c.CategoryId == categoryId));
 }
コード例 #6
0
 public IDataResult <Category> GetById(int id)
 {
     return(new SuccessDataResult <Category>(_categoryDal.GetById(id), Messages.CategoryMatchingTheFilterListed));
 }
コード例 #7
0
 //select * froum
 public List <Category> GetById(int categoryId)
 {
     return(_categoryDal.GetById(c => c.CategoryId == categoryId));
 }
コード例 #8
0
 public Category GetById(int id)
 {
     return(_categoryDal.GetById(c => c.CategoryId == id));
 }
コード例 #9
0
 public Category GetById(int id)
 {
     return(_categoryDal.GetById(x => x.CategoryID == id));
 }
コード例 #10
0
 public Category GetById(int id)
 {
     return(_categoryService.GetById(id));
 }
コード例 #11
0
 public Category GetByID(int id)
 {
     //gelen id'ye göre silme işlemi
     return(_categoryDal.GetById(x => x.CategoryID == id));
 }
コード例 #12
0
 public IDataResult <Category> GetById(int categoryId)
 {
     return(new SuccessDataResult <Category>(_categoryDal.GetById(c => c.CategoryID == categoryId), Messages.CategoryFound));
 }