示例#1
0
        public AuthorEfRepository(IHmmDataContext dataContext, IEntityLookup lookupRepo)
        {
            Guard.Against <ArgumentNullException>(dataContext == null, nameof(dataContext));
            Guard.Against <ArgumentNullException>(lookupRepo == null, nameof(lookupRepo));

            _dataContext = dataContext;
            _lookupRepo  = lookupRepo;
        }
示例#2
0
        protected RepositoryBase(IHmmDataContext dataContext, IEntityLookup lookupRepo, IDateTimeProvider dateTimeProvider)
        {
            Guard.Against <ArgumentNullException>(dataContext == null, nameof(dataContext));
            Guard.Against <ArgumentNullException>(lookupRepo == null, nameof(lookupRepo));
            Guard.Against <ArgumentNullException>(dateTimeProvider == null, nameof(dateTimeProvider));

            DataContext      = dataContext;
            LookupRepo       = lookupRepo;
            DateTimeProvider = dateTimeProvider;
        }
示例#3
0
        private void SetDbEnvironment(string connectString)
        {
            var optBuilder = new DbContextOptionsBuilder()
                             .UseSqlServer(connectString);

            _dbContext = new HmmDataContext(optBuilder.Options);
            LookupRepo = new EfEntityLookup(_dbContext);
            var dateProvider = new DateTimeAdapter();

            AuthorRepository    = new AuthorEfRepository(_dbContext, LookupRepo);
            NoteRepository      = new NoteEfRepository(_dbContext, LookupRepo, dateProvider);
            RenderRepository    = new NoteRenderEfRepository(_dbContext, LookupRepo, dateProvider);
            CatalogRepository   = new NoteCatalogEfRepository(_dbContext, LookupRepo, dateProvider);
            SubsystemRepository = new SubsystemEfRepository(_dbContext, LookupRepo, dateProvider);
            DateProvider        = new DateTimeAdapter();
        }
示例#4
0
 public NoteRenderEfRepository(
     IHmmDataContext dataContext,
     IEntityLookup lookupRepo,
     IDateTimeProvider dateTimeProvider) : base(dataContext, lookupRepo, dateTimeProvider)
 {
 }
示例#5
0
 public EfEntityLookup(IHmmDataContext dataContext)
 {
     Guard.Against <ArgumentNullException>(dataContext == null, nameof(dataContext));
     _dataContext = dataContext;
 }
示例#6
0
 public SubsystemEfRepository(IHmmDataContext dataContext, IEntityLookup lookupRepo, IDateTimeProvider dateTimeProvider) : base(dataContext, lookupRepo, dateTimeProvider)
 {
 }