public async Task <IActionResult> Create([Bind("Id,Name,Description,CycleStart")] Group @group) { if (ModelState.IsValid) { _context.Add(@group); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(@group)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,GroupId")] Member member) { if (ModelState.IsValid) { _context.Add(member); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Name", member.GroupId); return(View(member)); }