public IActionResult GetFoodTypes() { try { return(Ok(_foodTypeService.GetAll().ToApiModels())); } catch (Exception ex) { ModelState.AddModelError("GetFoodType", ex.Message); return(BadRequest(ModelState)); } }
public IEnumerable <FoodType> GetAll() { return(foodTypeService.GetAll()); }