public IHttpActionResult Create(PersonViewModel personViewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var person = _personRepo.Create(personViewModel); return(Ok(person)); }
public IActionResult Create(CreatePersonVM personvm) { if (ModelState.IsValid) { Person person = personvm.CreatePerson(); _people.Create(person); return(RedirectToAction("Index")); } return(View()); }
public Person Add(PersonCreateModel personCreateModel) { return(_personRepo.Create(personCreateModel.Name, personCreateModel.City, personCreateModel.Phonenumber)); }
public void Create(Person person) { personRepo.Create(person); }