예제 #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);
 }