public ChefViewModel CreateChef(ChefPostModel model) { var chef = _mapper.Map <ChefModel>(model); var addedChef = _chefService.CreateChef(chef); return(_mapper.Map <ChefViewModel>(addedChef)); }
public IHttpActionResult Post(ChefCreate Chef) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!chefService.CreateChef(Chef)) { return(InternalServerError()); } return(Ok()); }