Пример #1
0
        public PartialViewResult AddWish(WishFormModel wishFormModel)
        {
            if (ModelState.IsValid)
            {
                using (var context = new ShopContainer())
                {
                    var wish = new Wish();
                    TryUpdateModel(wish, new[] { "UserName", "Category", "Brand", "Title", "Size", "Color", "Phone", "Email" });
                    context.AddToWish(wish);
                    //context.SaveChanges();
                }
                return PartialView("Success");

            }
            else
            {
                return PartialView("_WishForm", wishFormModel);
            }
        }