Esempio n. 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));
        }
Esempio n. 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);
 }
Esempio n. 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);
 }