private void GetRepositories() { if (RepositoryCollection != null && RepositoryCollection.Any()) { RepositoryCollection.Clear(); } if (_repositoryTypeDictionary != null && _repositoryTypeDictionary.Any()) { _repositoryTypeDictionary.Clear(); } using (var session = DbService.Instance.SessionFactory.OpenSession()) { var repositories = session.QueryOver <Repository>().List <Repository>(); repositories.ForEach(repository => { RepositoryCollection.Add(repository.Name); _repositoryTypeDictionary.Add(repository.Name, repository.Type); }); } }