public async Task <IActionResult> Create([Bind("Id,Title,Location,Date,DistanceLength,DistanceMetric,CompetitionCode,TypeCode")] RunEvent runEvent) { if (ModelState.IsValid) { _context.Add(runEvent); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(runEvent)); }
public async Task <IActionResult> Create([Bind("Id,AmNumber,Active")] ClubMember clubMember) { if (ModelState.IsValid) { _context.Add(clubMember); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(clubMember)); }
public async Task <IActionResult> Create([Bind("Id,AthleteId,EventId,Result")] RaceMemberResult raceMemberResult) { if (ModelState.IsValid) { _context.Add(raceMemberResult); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AthleteId"] = new SelectList(_context.ClubMember, "Id", "Id", raceMemberResult.AthleteId); ViewData["EventId"] = new SelectList(_context.RunEvent, "Id", "CompetitionCode", raceMemberResult.EventId); return(View(raceMemberResult)); }