Esempio n. 1
0
        public Repository(IUnitOfWork unitOfWork)
        {
            Context = unitOfWork as EnglishTrainingDbContext;

            if (Context == null)
            {
                throw new InvalidOperationException("UnitOfWork of the type EnglishTrainingDbContext should be used while a entity framework data access are used.");
            }
        }
Esempio n. 2
0
        public TestDataInitializer(EnglishTrainingDbContext englishTrainingDbContext)
        {
            if (englishTrainingDbContext == null)
            {
                throw new ArgumentNullException(nameof(englishTrainingDbContext));
            }

            _englishTrainingDbContext = englishTrainingDbContext;
        }