-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make hosted service generic * inject hosted service and generic application
- Loading branch information
1 parent
2a289a6
commit 83cb4cd
Showing
6 changed files
with
72 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
src/environments/Backend.Fx.AspNetCore/BackendFxApplicationStartup.cs
This file was deleted.
Oops, something went wrong.
16 changes: 6 additions & 10 deletions
16
tests/Backend.Fx.AspNetCore.Tests/SampleApp/SampleApplicationHostedService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
using Backend.Fx.AspNetCore.Tests.SampleApp.Runtime; | ||
using Backend.Fx.Environment.MultiTenancy; | ||
using Backend.Fx.InMemoryPersistence; | ||
using Backend.Fx.Logging; | ||
using Backend.Fx.Patterns.DependencyInjection; | ||
using Backend.Fx.Patterns.EventAggregation.Integration; | ||
using JetBrains.Annotations; | ||
|
||
namespace Backend.Fx.AspNetCore.Tests.SampleApp | ||
{ | ||
public class SampleApplicationHostedService : BackendFxApplicationHostedService | ||
[UsedImplicitly] | ||
public class SampleApplicationHostedService : BackendFxApplicationHostedService<SampleApplication> | ||
{ | ||
public ITenantService TenantService { get; } | ||
public override IBackendFxApplication Application { get; } | ||
public override SampleApplication Application { get; } | ||
|
||
public SampleApplicationHostedService(IExceptionLogger exceptionLogger) | ||
public SampleApplicationHostedService(IExceptionLogger exceptionLogger, ITenantService tenantService) | ||
{ | ||
IMessageBus messageBus = new InMemoryMessageBus(); | ||
TenantService = new TenantService(messageBus, new InMemoryTenantRepository()); | ||
Application = new SampleApplication(TenantService.TenantIdProvider, exceptionLogger); | ||
Application = new SampleApplication(tenantService.TenantIdProvider, exceptionLogger); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
tests/Backend.Fx.AspNetCore.Tests/SampleApp/TenantAdminMiddleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters