コード例 #1
0
ファイル: PeopleController.cs プロジェクト: Gnutz/DABHI3.2
        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));
        }