public AuthorEfRepository(IHmmDataContext dataContext, IEntityLookup lookupRepo) { Guard.Against <ArgumentNullException>(dataContext == null, nameof(dataContext)); Guard.Against <ArgumentNullException>(lookupRepo == null, nameof(lookupRepo)); _dataContext = dataContext; _lookupRepo = lookupRepo; }
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; }
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(); }
public NoteRenderEfRepository( IHmmDataContext dataContext, IEntityLookup lookupRepo, IDateTimeProvider dateTimeProvider) : base(dataContext, lookupRepo, dateTimeProvider) { }
public EfEntityLookup(IHmmDataContext dataContext) { Guard.Against <ArgumentNullException>(dataContext == null, nameof(dataContext)); _dataContext = dataContext; }
public SubsystemEfRepository(IHmmDataContext dataContext, IEntityLookup lookupRepo, IDateTimeProvider dateTimeProvider) : base(dataContext, lookupRepo, dateTimeProvider) { }