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

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