Beispiel #1
0
        public IHttpActionResult Create(PersonViewModel personViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var person = _personRepo.Create(personViewModel);

            return(Ok(person));
        }
Beispiel #2
0
 public IActionResult Create(CreatePersonVM personvm)
 {
     if (ModelState.IsValid)
     {
         Person person = personvm.CreatePerson();
         _people.Create(person);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Beispiel #3
0
 public Person Add(PersonCreateModel personCreateModel)
 {
     return(_personRepo.Create(personCreateModel.Name, personCreateModel.City, personCreateModel.Phonenumber));
 }
 public void Create(Person person)
 {
     personRepo.Create(person);
 }