public void EditAddress(EditAddressBM bind) { Address address = Context.Addresses.Find(bind.Id); address.City = bind.City; address.Streat = bind.Streat; address.PostCode = bind.PostCode; address.PhoneNumber = bind.PhoneNumber; Context.SaveChanges(); }
public ActionResult Edit([Bind(Include = "Id, City, Streat, PhoneNumber, PostCode")] EditAddressBM bind) { if (this.ModelState.IsValid) { service.EditAddress(bind); return(this.RedirectToAction("MyAddresses")); } return(View()); }