public async Task <ActionResult> Create(RestaurantViewModel model) { try { var res = model.Restaurant; model.Restaurant.Id = (int)Session["customerId"]; res.Category = await _proxy.GetRestaurantCategoryAsync(model.SelectedCategoryId); await _proxy.CreateRestaurantAsync(res); return(RedirectToAction("Index")); } catch { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError)); } }
// GET: RestaurantCategory/Edit/5 public async Task <ActionResult> Edit(int id) { var cat = await _proxy.GetRestaurantCategoryAsync(id); return(View("Edit", cat)); }