Example #1
0
        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));
            }
        }