public void AddLandlord(LandlordsBindingModel landlordBindingModel) { Landlord landlord = Mapper.Map <Landlord>(landlordBindingModel); this.Context.Landlords.Add(landlord); this.Context.SaveChanges(); }
public ActionResult Add([Bind(Include = "FullName, PhoneNumber, IsAcceptingAnimals")] LandlordsBindingModel landlordsBindingModel) { if (ModelState.IsValid) { this.landlordService.AddLandlord(landlordsBindingModel); return(this.RedirectToAction("Index", "ControlPanel")); } return(this.View(landlordsBindingModel)); }