// GET: Sports/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } await auditLogger.log(GetUserId(), $"Accessed Edit Sport {id}"); var sport = await sportRepository.GetByIdAsync(id.Value); if (sport == null) { return(NotFound()); } return(View(sport)); }