// ReSharper disable once SuggestBaseTypeForParameter private static DbSet <TDocument> SelectDocumentFromDb(RalDbContext dbContext) { if (!DbSetsCache.ContainsKey(typeof(TDocument))) { DbSetsCache.Add(typeof(TDocument), dbContext.GetType() .GetProperties() .FirstOrDefault(p => p.PropertyType == typeof(DbSet <TDocument>))); } var dbSetType = DbSetsCache[typeof(TDocument)]; if (dbSetType != null) { return(dbSetType.GetValue(dbContext) as DbSet <TDocument>); } throw new Exception($"Generic type {typeof(TDocument)} invalid for DocumentRepository"); }
public EmployeeTimeClockRepository(RalDbContext dbContext) : base(dbContext.EmployeeTimeClocks) { }
public CompanyRepository(RalDbContext dbContext) { _dbContext = dbContext; }
public SalesmanRepository(RalDbContext dbContext) : base(dbContext.Salesmen) { _dbContext = dbContext; }
public AuthenticationRepository(RalDbContext dbContext) : base(dbContext.RefreshTokens) { _dbContext = dbContext; }
public ProductGroupRepository(RalDbContext dbContext) : base(dbContext.ProductGroups) { }
public LeadUserDataRepository(RalDbContext dbContext) : base(dbContext.LeadUserData) { _dbContext = dbContext; }
public ActivityRepository(RalDbContext dbContext) : base(dbContext.Activities) { _context = dbContext; }
public IdentityUserRepository(RalDbContext dbContext) : base(dbContext.IdentityUsers) { _dbContext = dbContext; }
public AttachmentRepository(RalDbContext dbContext) : base(dbContext.Attachments) { }
public BusinessPartnerRepository(RalDbContext dbContext) : base(dbContext.BusinessPartners) { _dbContext = dbContext; }
public EmployeesRepository(RalDbContext dbContext) : base(dbContext.Employees) { _dbContext = dbContext; }
public UserLocationRepository(RalDbContext dbContext) : base(dbContext.UserLocations) { }
public ProductRepository(RalDbContext dbContext) : base(dbContext.Products) { _dbContext = dbContext; }
public DocumentRepository(RalDbContext dbContext) { _dbContext = dbContext; SelectEntityQuery = SelectDocumentFromDb(dbContext); }