public async Task <IActionResult> Edit(int id, [Bind("Id,EventName,CompetitionDistances,CompetitionDate,Location")] RaceSchedule raceSchedule)
        {
            if (id != raceSchedule.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(raceSchedule);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RaceScheduleExists(raceSchedule.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(raceSchedule));
        }
        public async Task <IActionResult> Create([Bind("Id,EventName,CompetitionDistances,CompetitionDate,Location")] RaceSchedule raceSchedule)
        {
            if (ModelState.IsValid)
            {
                _context.Add(raceSchedule);
                await _context.SaveChangesAsync();

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