public ActionResult Details(string userName) { var chefToView = _chefService.GetChefByUserName(userName); if (chefToView == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = Mapper.Map <Chef, ChefDetailsViewModel>(chefToView); return(View(model)); }