public void AddNotebookFromBind(AddNotebookBm bind) { Notebooks notebook = Mapper.Map <AddNotebookBm, Notebooks>(bind); Context.Items.Add(notebook); Context.SaveChanges(); }
public ActionResult AddNotebook([Bind(Include = "Brand, Model, Price, Processor, RAM, Storage, VideoGraphic, OparationSystem, DisplaySize, Dimensions, Description, ImageUrl, Image2Url, Image3Url")]AddNotebookBm bind) { if (this.ModelState.IsValid) { this.service.AddNotebookFromBind(bind); return this.RedirectToAction("Index", "Admin"); } return View(); }