public async Task <ActionResult <Category> > GetCategoryById(int id) { var category = await _categoryDal.GetById(id); if (category == null) { return(NotFound()); } return(Ok(category)); }
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)); }
public IDataResult <List <Category> > GetById(int categoryId) { return(new SuccessDataResult <List <Category> >(_categoryDal.GetById(c => c.CategoryId == categoryId))); }
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)); }
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)); }
public Category GetById(int id) { return(_categoryService.GetById(id)); }
public Category GetByID(int id) { //gelen id'ye göre silme işlemi return(_categoryDal.GetById(x => x.CategoryID == id)); }
public IDataResult <Category> GetById(int categoryId) { return(new SuccessDataResult <Category>(_categoryDal.GetById(c => c.CategoryID == categoryId), Messages.CategoryFound)); }