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));
 }
 //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));
 }
 //select * froum
 public List <Category> GetById(int categoryId)
 {
     return(_categoryDal.GetById(c => c.CategoryId == categoryId));
 }
 public Category GetById(int id)
 {
     return(_categoryDal.GetById(c => c.CategoryId == id));
 }
 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));
 }