private ICensorship GetCensorship() { // 实例化服务容器 Zongsoft.Services.IServiceProvider serviceProvider = new Zongsoft.Services.ServiceProvider(); // 注册 DataAccess 实例 serviceProvider.Register(new DataAccess(DataProviderFactory.GetProvider()), typeof(IDataAccess)); // 返回用户提供程序 return new Censorship(serviceProvider); }
private IRoleProvider GetRoleProvider() { // 实例化服务容器 Zongsoft.Services.IServiceProvider serviceProvider = new Zongsoft.Services.ServiceProvider(); // 注册 DataAccess 实例 serviceProvider.Register(new DataAccess(DataProviderFactory.GetProvider()), typeof(IDataAccess)); // 返回用户提供程序 var provider = new RoleProvider(serviceProvider); provider.Censorship = this.GetCensorship(); return provider; }