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