示例#1
0
        public async Task <ActionResult> CreateAsync([Bind("PersonId, FirstName, MiddleName, Surname, Address, EmailAddresses")] Person person)
        {
            if (ModelState.IsValid)
            {
                await Respository.CreatePersonAsync(person);

                return(RedirectToAction("Index"));
            }

            return(View(person));
        }
示例#2
0
        public async Task <ActionResult> Post([Bind("Id, FirstName, MiddleName, Surname, Address, EmailAddress")] Person person)
        {
            if (ModelState.IsValid)
            {
                var newPerson = await Repository.CreatePersonAsync(person);

                return(Ok((Person)(dynamic)newPerson));
            }

            return(View(person));
        }