public ActionResult Save(AddressDbModel _data, long ID) { _data.CreatedOn = DateTime.Now; var data = repo.Save <AddressDbModel>(_data, ID); if (data != null) { return(RedirectToAction("Index", "Address")); } else { ModelState.AddModelError("", "Somehting went wront. Please try again"); return(View()); } }
public AddressDbModel GetAddressFromView() { var address = new AddressDbModel { Id = _view.AddressId, PersonID = _view.ContactId, AddressTypeID = _view.AddressTypeID, HomeNumber = _view.HomeNumber, Street = _view.Street, City = _view.City, Country = _view.Country }; return(address); }
public async Task <int> SaveAddressAsync(AddressDbModel address) { await _db.InsertOrReplaceAsync(address); return(address.Id); }