public WordRepository(DbContextDictionaryOfWords contextDictionaryOfWords) : base(contextDictionaryOfWords)
        {
            _dbSet = contextDictionaryOfWords.Words;
            IQueryable <Word> includeWord = GetInclude();

            base.DbSetInclude = includeWord;
        }
        public UnitOfWork(DbContextDictionaryOfWords contextDictionaryOfWords)
        {
            _contextDictionaryOfWords = contextDictionaryOfWords;
            _repositories             = new ConcurrentDictionary <Type, object>();

            Language        = new LanguageRepository(contextDictionaryOfWords);
            Word            = new WordRepository(contextDictionaryOfWords);
            WordTranslation = new WordTranslationRepository(contextDictionaryOfWords);
        }
Beispiel #3
0
        public UnitOfWork(DbContextDictionaryOfWords contextDictionaryOfWords)
        {
            _contextDictionaryOfWords = contextDictionaryOfWords;
            _repositories             = new ConcurrentDictionary <Type, object>();

            // Лучше было бы инъектить их через конструктор из DI.
            Language        = new LanguageRepository(contextDictionaryOfWords);
            Word            = new WordRepository(contextDictionaryOfWords);
            WordTranslation = new WordTranslationRepository(contextDictionaryOfWords);
        }
 public LanguageRepository(DbContextDictionaryOfWords contextDictionaryOfWords) : base(contextDictionaryOfWords)
 {
     _dbSet = contextDictionaryOfWords.Languages;
 }
 public RepositoryBase(DbContextDictionaryOfWords contextDictionaryOfWords)
 {
     _contextDictionaryOfWords = contextDictionaryOfWords;
     _dbSet = _contextDictionaryOfWords.Set <T>();
 }