コード例 #1
0
        public async Task <IActionResult> Create(CreateMemberVm vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            var newMemberToAdd = new Member();

            newMemberToAdd.Name = vm.Name;
            newMemberToAdd.SSN  = vm.SSN;
            memberService.AddNewMember(newMemberToAdd);

            return(RedirectToAction(nameof(Index)));
        }