コード例 #1
0
 public void AddMember(Member member)
 {
     if (member.EMail == null)
     {
         throw new Exception();
     }
     ecommercialwebSiteDbContext.Add(member);
     ecommercialwebSiteDbContext.SaveChanges();
 }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("MemberID,Name,LastName,UserName,EMail")] Member member)
        {
            if (ModelState.IsValid)
            {
                _context.Add(member);
                await _context.SaveChangesAsync();

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