public IEnumerable <CategoryDto> GetAllCategory()
 {
     try
     {
         return(_category.GetAllCategories());
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #2
0
 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));
        }