Exemple #1
0
        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));
        }
Exemple #2
0
 public async Task ExecuteNotificationAsync(INotificationCommand notification)
 {
     using var scope = BetCompositionRoot.BeginScope();
     var mediator = scope.ServiceProvider.GetService(typeof(IMediator)) as IMediator;
     await mediator.Publish(notification);
 }
Exemple #3
0
 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);
 }