public ActionResult Create([Bind(Include = "Code")] userCheck model) { Table requestTable = db.Table.Find(model.Code); if (requestTable != null) { model.CheckTable = requestTable; model.CheckLocal = requestTable.Local; model.CheckRestaurant = requestTable.Local.Restaurant; model.DistrictCompeteName = _common.DistrictCompleteName(requestTable.Local.IdDistrict); model.UserDishes = ""; model.types = db.PR_GetTypes(requestTable.Local.Restaurant.IdRestaurant).Select(m => db.Type.Find(m)).ToList(); return(View(model)); } return(RedirectToAction("Invalid", "Checks")); }