public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var entity = await eventsRepository.FindEventByIdAsync(id.Value); if (entity == null) { return(NotFound()); } return(View(entity)); }