public EFDbContext(DbContextOptions <TContext> options, ServiceCollectionHolder serviceCollectionHolder) : base(options) { _entityTypes = new List <Type>(); foreach (var item in serviceCollectionHolder.ServiceCollection) { var belongs = item.ImplementationType?.BaseType?.BaseType.EqualsToGeneric(typeof(EFRepository <, ,>)); if (belongs != null && belongs.Value) { var typeParameters = item.ImplementationType.BaseType.GetGenericArguments(); if (typeParameters.Length == 2) { _entityTypes.Add(typeParameters[1]); } } } }
public PostgresDatabaseContext( DbContextOptions <PostgresDatabaseContext> options, ServiceCollectionHolder serviceCollectionHolder) : base(options, serviceCollectionHolder) { }
public MSSQLDatabaseContext( DbContextOptions <MSSQLDatabaseContext> options, ServiceCollectionHolder serviceCollectionHolder) : base(options, serviceCollectionHolder) { }