-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f35f2d7
commit 0bbb374
Showing
16 changed files
with
171 additions
and
73 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Shared.Features.CQRS.DomainEvent; | ||
using Shared.Features.CQRS.IntegrationEvent; | ||
using Shared.Features.CQRS.Query; | ||
using Shared.Kernel.BuildingBlocks.ModelValidation; | ||
using Shared.Kernel.BuildingBlocks; | ||
using Shared.Features.Server; | ||
|
||
namespace Shared.Features.CQRS.Command | ||
{ | ||
public class BaseCommandHandler : ServerExecutionBase | ||
{ | ||
public IExecutionContext ExecutionContext { get; } | ||
public ICommandDispatcher CommandDispatcher { get; } | ||
public IQueryDispatcher QueryDispatcher { get; } | ||
public IIntegrationEventDispatcher IntegrationEventDispatcher { get; } | ||
public IDomainEventDispatcher DomainEventDispatcher { get; } | ||
public IValidationService ValidationService { get; } | ||
|
||
public BaseCommandHandler(IServiceProvider serviceProvider) | ||
{ | ||
ExecutionContext = serviceProvider.GetRequiredService<IExecutionContext>(); | ||
CommandDispatcher = serviceProvider.GetRequiredService<ICommandDispatcher>(); | ||
QueryDispatcher = serviceProvider.GetRequiredService<IQueryDispatcher>(); | ||
IntegrationEventDispatcher = serviceProvider.GetRequiredService<IIntegrationEventDispatcher>(); | ||
DomainEventDispatcher = serviceProvider.GetRequiredService<IDomainEventDispatcher>(); | ||
ValidationService = serviceProvider.GetRequiredService<IValidationService>(); | ||
} | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
Source/Shared/Features/CQRS/DomainEvent/BaseDomainEventHandler.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Shared.Features.CQRS.Command; | ||
using Shared.Features.CQRS.IntegrationEvent; | ||
using Shared.Features.CQRS.Query; | ||
using Shared.Kernel.BuildingBlocks.ModelValidation; | ||
using Shared.Kernel.BuildingBlocks; | ||
using Shared.Features.Server; | ||
|
||
namespace Shared.Features.CQRS.DomainEvent | ||
{ | ||
public class BaseDomainEventHandler : ServerExecutionBase | ||
{ | ||
public IExecutionContext ExecutionContext { get; } | ||
public ICommandDispatcher CommandDispatcher { get; } | ||
public IQueryDispatcher QueryDispatcher { get; } | ||
public IIntegrationEventDispatcher IntegrationEventDispatcher { get; } | ||
public IDomainEventDispatcher DomainEventDispatcher { get; } | ||
public IValidationService ValidationService { get; } | ||
|
||
public BaseDomainEventHandler(IServiceProvider serviceProvider) | ||
{ | ||
ExecutionContext = serviceProvider.GetRequiredService<IExecutionContext>(); | ||
CommandDispatcher = serviceProvider.GetRequiredService<ICommandDispatcher>(); | ||
QueryDispatcher = serviceProvider.GetRequiredService<IQueryDispatcher>(); | ||
IntegrationEventDispatcher = serviceProvider.GetRequiredService<IIntegrationEventDispatcher>(); | ||
DomainEventDispatcher = serviceProvider.GetRequiredService<IDomainEventDispatcher>(); | ||
ValidationService = serviceProvider.GetRequiredService<IValidationService>(); | ||
} | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
Source/Shared/Features/CQRS/IntegrationEvent/BaseIntegrationEventHandler.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Shared.Features.CQRS.Command; | ||
using Shared.Features.CQRS.DomainEvent; | ||
using Shared.Features.CQRS.Query; | ||
using Shared.Kernel.BuildingBlocks.ModelValidation; | ||
using Shared.Kernel.BuildingBlocks; | ||
using Shared.Features.Server; | ||
|
||
namespace Shared.Features.CQRS.IntegrationEvent | ||
{ | ||
public class BaseIntegrationEventHandler : ServerExecutionBase | ||
{ | ||
public IExecutionContext ExecutionContext { get; } | ||
public ICommandDispatcher CommandDispatcher { get; } | ||
public IQueryDispatcher QueryDispatcher { get; } | ||
public IIntegrationEventDispatcher IntegrationEventDispatcher { get; } | ||
public IDomainEventDispatcher DomainEventDispatcher { get; } | ||
public IValidationService ValidationService { get; } | ||
|
||
public BaseIntegrationEventHandler(IServiceProvider serviceProvider) | ||
{ | ||
ExecutionContext = serviceProvider.GetRequiredService<IExecutionContext>(); | ||
CommandDispatcher = serviceProvider.GetRequiredService<ICommandDispatcher>(); | ||
QueryDispatcher = serviceProvider.GetRequiredService<IQueryDispatcher>(); | ||
IntegrationEventDispatcher = serviceProvider.GetRequiredService<IIntegrationEventDispatcher>(); | ||
DomainEventDispatcher = serviceProvider.GetRequiredService<IDomainEventDispatcher>(); | ||
ValidationService = serviceProvider.GetRequiredService<IValidationService>(); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
using Shared.Features.Server; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Shared.Features.CQRS.Command; | ||
using Shared.Features.CQRS.DomainEvent; | ||
using Shared.Features.CQRS.IntegrationEvent; | ||
using Shared.Features.Server; | ||
using Shared.Kernel.BuildingBlocks; | ||
using Shared.Kernel.BuildingBlocks.ModelValidation; | ||
|
||
namespace Shared.Features.CQRS.Query | ||
{ | ||
public class BaseQueryHandler : IInServerExecutionScope | ||
public class BaseQueryHandler : ServerExecutionBase | ||
{ | ||
public IServerExecutionContext ExecutionContext { get; private set; } | ||
public BaseQueryHandler(IServiceProvider serviceProvider) : base(serviceProvider) | ||
{ | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Shared.Features.CQRS.Command; | ||
using Shared.Features.CQRS.DomainEvent; | ||
using Shared.Features.CQRS.IntegrationEvent; | ||
using Shared.Features.CQRS.Query; | ||
using Shared.Kernel.BuildingBlocks; | ||
using Shared.Kernel.BuildingBlocks.ModelValidation; | ||
|
||
namespace Shared.Features.Server | ||
{ | ||
public class BaseController : ControllerBase, InServerExecutionScopeBase | ||
public class BaseController : ControllerBase, ServerExecutionBase | ||
{ | ||
public IServerExecutionContext ExecutionContext { get; } | ||
|
||
protected readonly IValidationService validationService; | ||
public IExecutionContext ExecutionContext { get; } | ||
public ICommandDispatcher CommandDispatcher { get; } | ||
public IQueryDispatcher QueryDispatcher { get; } | ||
public IIntegrationEventDispatcher IntegrationEventDispatcher { get; } | ||
public IDomainEventDispatcher DomainEventDispatcher { get; } | ||
public IValidationService ValidationService { get; } | ||
|
||
public BaseController(IServiceProvider serviceProvider) | ||
{ | ||
ExecutionContext = serviceProvider.GetRequiredService<IServerExecutionContext>(); | ||
validationService = serviceProvider.GetRequiredService<IValidationService>(); | ||
ExecutionContext = serviceProvider.GetRequiredService<IExecutionContext>(); | ||
CommandDispatcher = serviceProvider.GetRequiredService<ICommandDispatcher>(); | ||
QueryDispatcher = serviceProvider.GetRequiredService<IQueryDispatcher>(); | ||
IntegrationEventDispatcher = serviceProvider.GetRequiredService<IIntegrationEventDispatcher>(); | ||
DomainEventDispatcher = serviceProvider.GetRequiredService<IDomainEventDispatcher>(); | ||
ValidationService = serviceProvider.GetRequiredService<IValidationService>(); | ||
} | ||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
Source/Shared/Features/Server/InServerExecutionScopeBase.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.