コード例 #1
0
        /// <summary>
        /// Called when [composable parts loaded].
        /// </summary>
        /// <returns>Task.</returns>
        public Task LoadRepositories(IServerConfigurationManager configurationManager)
        {
            // Get the current item repository
            ItemRepository = GetRepository(ItemRepositories, configurationManager.Configuration.ItemRepository);
            var itemRepoTask = ItemRepository.Initialize();

            // Get the current user repository
            UserRepository = GetRepository(UserRepositories, configurationManager.Configuration.UserRepository);
            var userRepoTask = UserRepository.Initialize();

            // Get the current item repository
            UserDataRepository = GetRepository(UserDataRepositories, configurationManager.Configuration.UserDataRepository);
            var userDataRepoTask = UserDataRepository.Initialize();

            // Get the current display preferences repository
            DisplayPreferencesRepository = GetRepository(DisplayPreferencesRepositories, configurationManager.Configuration.DisplayPreferencesRepository);
            var displayPreferencesRepoTask = DisplayPreferencesRepository.Initialize();

            return(Task.WhenAll(itemRepoTask, userRepoTask, userDataRepoTask, displayPreferencesRepoTask));
        }
コード例 #2
0
 /// <summary>
 /// Configures the repositories.
 /// </summary>
 /// <returns>Task.</returns>
 private async Task ConfigureDisplayPreferencesRepositories()
 {
     await DisplayPreferencesRepository.Initialize().ConfigureAwait(false);
 }