usingSystem.Threading.Tasks;usingMicrosoft.AspNetCore.Mvc;usingTestingControllersSample.Core.Interfaces;usingTestingControllersSample.ViewModels;namespaceTestingControllersSample.Controllers{publicclassSessionController:Controller{privatereadonlyIBrainstormSessionRepository_sessionRepository;publicSessionController(IBrainstormSessionRepositorysessionRepository){_sessionRepository=sessionRepository;}publicasyncTask<IActionResult>Index(int?id){if(!id.HasValue){returnRedirectToAction("Index","Home");}varsession=await_sessionRepository.GetByIdAsync(id.Value);if(session==null){returnContent("Session not found.");}varviewModel=newStormSessionViewModel(){DateCreated=session.DateCreated,Name=session.Name,Id=session.Id};returnView(viewModel);}}}