public void AddMember(Member member) { if (member.EMail == null) { throw new Exception(); } ecommercialwebSiteDbContext.Add(member); ecommercialwebSiteDbContext.SaveChanges(); }
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)); }