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); } }
/// <summary> /// Deprecated Method for adding a new object to the Wish EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToWish(Wish wish) { base.AddObject("Wish", wish); }
/// <summary> /// Create a new Wish object. /// </summary> /// <param name="id">Initial value of the Id property.</param> public static Wish CreateWish(global::System.Int32 id) { Wish wish = new Wish(); wish.Id = id; return wish; }