优化扩展

This commit is contained in:
橙子
2021-10-13 15:40:56 +08:00
parent 16eb1fb1e2
commit e9bc71393c
28 changed files with 687 additions and 326 deletions

View File

@@ -39,9 +39,12 @@ namespace Yi.Framework.ApiMicroservice.Utility
//containerBuilder.RegisterType<A>().As<IA>().EnableInterfaceInterceptors();开启Aop
//将数据库对象注入
containerBuilder.RegisterType<DataContext>().As<DbContext>().InstancePerLifetimeScope().EnableInterfaceInterceptors();
//containerBuilder.RegisterType<DataContext>().As<DbContext>().InstancePerLifetimeScope().EnableInterfaceInterceptors();
containerBuilder.RegisterGeneric(typeof(BaseService<>)).As(typeof(IBaseService<>)).EnableInterfaceInterceptors();
containerBuilder.RegisterGeneric(typeof(BaseService<>)).As(typeof(IBaseService<>)).InstancePerLifetimeScope().EnableInterfaceInterceptors();
containerBuilder.RegisterType<UserService>().As< IUserService >().InstancePerLifetimeScope().EnableInterfaceInterceptors();
containerBuilder.RegisterType<RoleService>().As<IRoleService>().InstancePerLifetimeScope().EnableInterfaceInterceptors();
}