mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-06 01:30:53 +08:00
优化扩展
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user