// 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)
 {
 }
Exemplo n.º 3
0
 public CompanyRepository(RalDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 4
0
 public SalesmanRepository(RalDbContext dbContext) : base(dbContext.Salesmen)
 {
     _dbContext = dbContext;
 }
 public AuthenticationRepository(RalDbContext dbContext) : base(dbContext.RefreshTokens)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 6
0
 public ProductGroupRepository(RalDbContext dbContext) : base(dbContext.ProductGroups)
 {
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 10
0
 public AttachmentRepository(RalDbContext dbContext) : base(dbContext.Attachments)
 {
 }
Exemplo n.º 11
0
 public BusinessPartnerRepository(RalDbContext dbContext) : base(dbContext.BusinessPartners)
 {
     _dbContext = dbContext;
 }
 public EmployeesRepository(RalDbContext dbContext) : base(dbContext.Employees)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 13
0
 public UserLocationRepository(RalDbContext dbContext) : base(dbContext.UserLocations)
 {
 }
Exemplo n.º 14
0
 public ProductRepository(RalDbContext dbContext) : base(dbContext.Products)
 {
     _dbContext = dbContext;
 }
 public DocumentRepository(RalDbContext dbContext)
 {
     _dbContext        = dbContext;
     SelectEntityQuery = SelectDocumentFromDb(dbContext);
 }