public UnitOfWork(DbContextDictionaryOfWords contextDictionaryOfWords) { _contextDictionaryOfWords = contextDictionaryOfWords; _repositories = new ConcurrentDictionary <Type, object>(); Language = new LanguageRepository(contextDictionaryOfWords); Word = new WordRepository(contextDictionaryOfWords); WordTranslation = new WordTranslationRepository(contextDictionaryOfWords); }
public UnitOfWork(DbContextDictionaryOfWords contextDictionaryOfWords) { _contextDictionaryOfWords = contextDictionaryOfWords; _repositories = new ConcurrentDictionary <Type, object>(); // Лучше было бы инъектить их через конструктор из DI. Language = new LanguageRepository(contextDictionaryOfWords); Word = new WordRepository(contextDictionaryOfWords); WordTranslation = new WordTranslationRepository(contextDictionaryOfWords); }