public override void Initialize() { IocManager.RegisterAssemblyByConvention(typeof(AbpFreeSqlExtensionsModule).GetAssembly()); using (IScopedIocResolver scope = IocManager.CreateScope()) { ISecondaryOrmRegistrar[] additionalOrmRegistrars = scope.ResolveAll <ISecondaryOrmRegistrar>(); foreach (ISecondaryOrmRegistrar registrar in additionalOrmRegistrars) { if (registrar.OrmContextKey == "EntityFramework") { registrar.RegisterRepositories(IocManager, EfBasedFreeSqlAutoRepositoryTypes.Default); } if (registrar.OrmContextKey == "NHibernate") { registrar.RegisterRepositories(IocManager, NhBasedFreeSqlAutoRepositoryTypes.Default); } if (registrar.OrmContextKey == "EntityFrameworkCore") { registrar.RegisterRepositories(IocManager, EfBasedFreeSqlAutoRepositoryTypes.Default); } } } }
public override void Initialize() { IocManager.RegisterAssemblyByConvention(typeof(SharePlatformDapperModule).GetAssembly()); using (IScopedIocResolver scope = IocManager.CreateScope()) { ISecondaryOrmRegistrar[] additionalOrmRegistrars = scope.ResolveAll <ISecondaryOrmRegistrar>(); foreach (ISecondaryOrmRegistrar registrar in additionalOrmRegistrars) { if (registrar.OrmContextKey == SharePlatformConsts.Orms.EntityFramework) { registrar.RegisterRepositories(IocManager, EfBasedDapperAutoRepositoryTypes.Default); } if (registrar.OrmContextKey == SharePlatformConsts.Orms.NHibernate) { registrar.RegisterRepositories(IocManager, NhBasedDapperAutoRepositoryTypes.Default); } if (registrar.OrmContextKey == SharePlatformConsts.Orms.EntityFrameworkCore) { registrar.RegisterRepositories(IocManager, EfBasedDapperAutoRepositoryTypes.Default); } } } }