Exemplo n.º 1
0
        public UnitOfWork(DbContextDictionaryOfWords contextDictionaryOfWords)
        {
            _contextDictionaryOfWords = contextDictionaryOfWords;
            _repositories             = new ConcurrentDictionary <Type, object>();

            Language        = new LanguageRepository(contextDictionaryOfWords);
            Word            = new WordRepository(contextDictionaryOfWords);
            WordTranslation = new WordTranslationRepository(contextDictionaryOfWords);
        }
Exemplo n.º 2
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);
        }