public IEnumerable <CategoryDto> GetAllCategory() { try { return(_category.GetAllCategories()); } catch (Exception) { throw; } }
public List <CategoryDTO> GetAllCategories() { return(_categoryDal.GetAllCategories()); }
public HttpResponseMessage GetCategories() { var categoryList = _categoryDal.GetAllCategories().Select(c => new { c.Id, c.Name }); return(Request.CreateResponse(HttpStatusCode.OK, categoryList)); }