Example #1
0
 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));
        }
Example #3
0
        /// <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());
            }
        }
Example #4
0
        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));
        }
Example #5
0
        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));
        }
Example #6
0
        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));
        }
Example #7
-1
 public async Task InitializeDatabaseAsync(IBrainstormSessionRepository repo)
 {
     var sessionList = await repo.ListAsync();
     if (!sessionList.Any())
     {
         await repo.AddAsync(GetTestSession());
     }
 }