예제 #1
0
        public void AddLandlord(LandlordsBindingModel landlordBindingModel)
        {
            Landlord landlord = Mapper.Map <Landlord>(landlordBindingModel);

            this.Context.Landlords.Add(landlord);
            this.Context.SaveChanges();
        }
예제 #2
0
 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));
 }