Esempio n. 1
0
    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]);
                }
            }
        }
    }
Esempio n. 2
0
 public PostgresDatabaseContext(
     DbContextOptions <PostgresDatabaseContext> options,
     ServiceCollectionHolder serviceCollectionHolder)
     : base(options, serviceCollectionHolder)
 {
 }
Esempio n. 3
0
 public MSSQLDatabaseContext(
     DbContextOptions <MSSQLDatabaseContext> options,
     ServiceCollectionHolder serviceCollectionHolder)
     : base(options, serviceCollectionHolder)
 {
 }