public async Task <IActionResult> Create([Bind("ID,statDate,age,weight,height,MembersID")] Stats stats) { if (ModelState.IsValid) { _context.Add(stats); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MembersID"] = new SelectList(_context.Membership, "ID", "name", stats.MembersID); return(View(stats)); }
public async Task <IActionResult> Create([Bind("ID,name,gender,address,city,state,zip,email,cell")] Members members) { if (ModelState.IsValid) { _context.Add(members); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewBag.gender = genderList(); return(View(members)); }
public void AddEntity(T t) { _context.Add(t); }