//[HttpPost] public ActionResult Save(AddressModel model) { //throw new Exception("test"); if (ModelState.IsValid) { using (AdventureWorksEntities data = new AdventureWorksEntities()) { Address adresa = new Address(); adresa.AddressLine1 = model.AddressLine1; adresa.AddressLine2 = model.AddressLine2; //data.SaveChanges(); } } return View(); }
public ActionResult DataAnotationTest() { AddressModel model = new AddressModel(); model.AddressLine1 = "adresa 1"; model.AddressLine2 = "adresa 2"; return View(model); }