wip
This commit is contained in:
parent
f3ab94eff1
commit
31666b4ba0
34 changed files with 140 additions and 83 deletions
|
|
@ -0,0 +1,25 @@
|
|||
using Microsoft.ApplicationInsights;
|
||||
|
||||
namespace PlanTempus.Components.Users.Create;
|
||||
|
||||
public class CreateUserHandlerDecorator : ICommandHandler<CreateUserCommand, CreateUserResult>
|
||||
{
|
||||
private readonly ICommandHandler<CreateUserCommand, CreateUserResult> _decoratedHandler;
|
||||
private readonly TelemetryClient _telemetryClient;
|
||||
|
||||
public CreateUserHandlerDecorator(
|
||||
ICommandHandler<CreateUserCommand, CreateUserResult> decoratedHandler,
|
||||
TelemetryClient telemetryClient)
|
||||
{
|
||||
_decoratedHandler = decoratedHandler;
|
||||
_telemetryClient = telemetryClient;
|
||||
}
|
||||
|
||||
public async Task<CreateUserResult> Handle(CreateUserCommand command)
|
||||
{
|
||||
_telemetryClient.TrackTrace($"Before handling {nameof(CreateUserCommand)}");
|
||||
var result = await _decoratedHandler.Handle(command);
|
||||
_telemetryClient.TrackTrace($"After handling {nameof(CreateUserCommand)}");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue