Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Name,Email")] Person person)
        {
            if (ModelState.IsValid)
            {
                await _people.CreateAsync(person);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(person));
        }
        public async Task <IActionResult> CreateAsync(Person person)
        {
            var savedPerson = await _peopleService.CreateAsync(person);

            if (savedPerson == null)
            {
                return(Conflict());
            }

            return(CreatedAtAction(nameof(GetByIdAsync), new { id = person.Email }, person));
        }
        public async Task <ApiResultLite> CreateAsync(PeopleCreateRequest request)
        {
            var result = await _PeopleService.CreateAsync(request);

            return(result);
        }