public TenantService(IEventPublisher eventPublisher, IdentityApplicationService identityApplicationService, ITenantAddressRepository tenantAddressRepository, ITenantContactRepository tenantContactRepository, IBusinessInformationService businessInformationService) { _eventPublisher = eventPublisher; _identityApplicationService = identityApplicationService; _tenantAddressRepository = tenantAddressRepository; _tenantContactRepository = tenantContactRepository; _businessInformationService = businessInformationService; }
public TenantService(IEventPublisher eventPublisher, IdentityApplicationService identityApplicationService) { _eventPublisher = eventPublisher; _identityApplicationService = identityApplicationService; }
static void Main(string[] args) { var optionsBuilder = new DbContextOptionsBuilder <IdentityAccessDbContext>(); optionsBuilder .UseMySql("Server=localhost;database=IdentityAccess;uid=root;pwd=P@ssword;oldguids=true;SslMode=None") .EnableSensitiveDataLogging(); IdentityAccessDbContext context = new IdentityAccessDbContext(optionsBuilder.Options); //IdentityApplicationService identityApplicationService = new IdentityApplicationService(); //setup our DI var serviceProvider = new ServiceCollection() .AddScoped(s => context) .AddSingleton <AuthenticationService>(_ => new AuthenticationService( _.GetService <ITenantRepository>(), _.GetService <IUserRepository>(), _.GetService <IEncryptionService>())) .AddSingleton <GroupMemberService>(_ => new GroupMemberService( _.GetService <IUserRepository>(), _.GetService <IGroupRepository>())) .AddSingleton <TenantProvisioningService>(_ => new TenantProvisioningService( _.GetService <ITenantRepository>(), _.GetService <IUserRepository>(), _.GetService <IRoleRepository>())) .AddSingleton <ITenantRepository, TenantRepository>() .AddSingleton <IUserRepository, UserRepository>() .AddSingleton <IRoleRepository, RoleRepository>() .AddSingleton <IGroupRepository, GroupRepository>() .AddSingleton <IEncryptionService, MD5EncryptionService>() .AddSingleton <IdentityApplicationService>(s => new IdentityApplicationService( s.GetService <AuthenticationService>(), s.GetService <GroupMemberService>(), s.GetService <IGroupRepository>(), s.GetService <TenantProvisioningService>(), s.GetService <ITenantRepository>(), s.GetService <IUserRepository>() )) .AddTransient <IInt, Greeter>() .AddTransient <PrivateClass>() .BuildServiceProvider(); using (var scope1 = serviceProvider.CreateScope()) { var p = scope1.ServiceProvider; //IInt @int = p.GetService<IInt>(); //@int.Greeting(); PrivateClass privateClass = p.GetService <PrivateClass>(); privateClass.Greet(); TenantProvisioningService tenantProvisioningService = p.GetService <TenantProvisioningService>(); ProvisionTenantCommand command = new ProvisionTenantCommand( "abc" + Guid.NewGuid().ToString().Replace("-", ""), "description", "Jack" + Guid.NewGuid().ToString(), "Leung" + Guid.NewGuid().ToString(), "abc" + Guid.NewGuid().ToString().Replace("-", "") + "*****@*****.**", "123-123-1234", "123-123-1234", "123", "123", "123", "123", "123" ); IdentityApplicationService identityApplicationService = p.GetService <IdentityApplicationService>(); identityApplicationService.ProvisionTenant(command); //using (var processor = new ReservationCommandProcessor()) //{ // processor.Start(); // Console.WriteLine("Host started"); // Console.WriteLine("Press enter to finish"); // Console.ReadLine(); // processor.Stop(); //} } }
protected override void SetUp() { base.SetUp(); this._tenantRepository = new Mock<ITenantRepository>(); this._groupRepository = new Mock<IGroupRepository>(); this._userRepository = new Mock<IUserRepository>(); this._roleRepository = new Mock<IRoleRepository>(); this._authenticationService = new AuthenticationService(_tenantRepository.Object, _userRepository.Object, ServiceLocator.GetService<IEncryptionService>()); this._groupMemberService = new GroupMemberService(this._userRepository.Object, this._groupRepository.Object); this._tenantProvisioningService = new TenantProvisioningService(_tenantRepository.Object, _userRepository.Object, _roleRepository.Object); this._identityApplicationService = new IdentityApplicationService(this._authenticationService, this._groupMemberService, this._tenantProvisioningService, this._tenantRepository.Object, this._groupRepository.Object, this._userRepository.Object); }
public AccountController(IdentityApplicationService identityApplicationService) { _identityApplicationService = identityApplicationService; }
public TenantController(IdentityApplicationService identityApplicationService) { _identityApplicationService = identityApplicationService; //InitializeTenants(); }