public async Task <TResult> ExecuteQueryAsync <TResult>(IQuery <TResult> query) { using var scope = BetCompositionRoot.BeginScope(); var mediator = scope.ServiceProvider.GetService(typeof(IMediator)) as IMediator; return(await mediator.Send(query)); }
public async Task ExecuteNotificationAsync(INotificationCommand notification) { using var scope = BetCompositionRoot.BeginScope(); var mediator = scope.ServiceProvider.GetService(typeof(IMediator)) as IMediator; await mediator.Publish(notification); }
public async Task ExecuteCommandAsync <TRequest>(ICommand <TRequest> command) { using var scope = BetCompositionRoot.BeginScope(); var mediator = scope.ServiceProvider.GetService(typeof(IMediator)) as IMediator; await mediator.Send(command); }