public async Task InitializeDatabaseAsync(IBrainstormSessionRepository repo) { var sessionList = await repo.ListAsync(); if (!sessionList.Any()) { await repo.AddAsync(GetTestSession()); } }
public async Task <IActionResult> Index() { var sessionList = await _sessionRepository.ListAsync(); var model = sessionList.Select(session => new BrainstormSession() { ID = session.ID, DateCreated = session.DateCreated, Name = session.Name, }); return(View(model)); }
/// <summary> /// Method for initialize database. /// </summary> /// <param name="repo">Interface of repository.</param> /// <returns>Nothing.</returns> public static async Task InitializeDatabaseAsync(IBrainstormSessionRepository repo) { if (repo is null) { throw new ArgumentNullException(nameof(repo)); } var sessionList = await repo.ListAsync(); if (!sessionList.Any()) { await repo.AddAsync(GetTestSession()); } }
public async Task <IActionResult> Index() { var sessionList = await _sessionRepository.ListAsync(); var model = sessionList.Select(session => new StormSessionViewModel() { Id = session.Id, DateCreated = session.DateCreated, Name = session.Name, IdeaCount = session.Ideas.Count }); return(View(model)); }
public async Task <IActionResult> Index() { var sessionList = await _sessionRepository.ListAsync(); var model = sessionList.Select(session => new StormSessionViewModel() { Id = session.Id, DateCreated = session.DateCreated, Name = session.Name, IdeaCount = session.Ideas.Count }); var text = ControllerContext.ActionDescriptor.Properties["description"]; return(View(model)); }
public async Task <IActionResult> Index() { Logger.Info($"{nameof(Index)} started processing request"); var sessionList = await _sessionRepository.ListAsync(); var model = sessionList.Select(session => new StormSessionViewModel() { Id = session.Id, DateCreated = session.DateCreated, Name = session.Name, IdeaCount = session.Ideas.Count }); Logger.Info($"{nameof(Index)} finished processing request"); return(View(model)); }