public bool CreateChef(ChefCreate model) { var entity = new Chef() { Full_Name = model.Full_Name, Speciality = model.Speciality, }; _context.Chefs.Add(entity); return(_context.SaveChanges() == 1); }
public IHttpActionResult Post(ChefCreate Chef) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!chefService.CreateChef(Chef)) { return(InternalServerError()); } return(Ok()); }