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

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

            Language        = new LanguageRepository(contextDictionaryOfWords);
            Word            = new WordRepository(contextDictionaryOfWords);
            WordTranslation = new WordTranslationRepository(contextDictionaryOfWords);
        }
예제 #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;
 }
예제 #5
0
 public RepositoryBase(DbContextDictionaryOfWords contextDictionaryOfWords)
 {
     _contextDictionaryOfWords = contextDictionaryOfWords;
     _dbSet = _contextDictionaryOfWords.Set <T>();
 }