Beispiel #1
0
 public async Task <TResult> ExecuteCommandAsync <TResult>(ICommand <TResult> command)
 {
     using (var scope = AuthorizationCompositionRoot.BeginLifetimeScope())
     {
         var commandBus = scope.Resolve <ICommandBus>();
         return(await commandBus.ExecuteCommandAsync(command));
     }
 }
Beispiel #2
0
 public async Task <TResult> ExecuteQueryAsync <TResult>(IQuery <TResult> query)
 {
     using (var scope = AuthorizationCompositionRoot.BeginLifetimeScope())
     {
         var queryBus = scope.Resolve <IQueryBus>();
         return(await queryBus.ExecuteQueryAsync(query));
     }
 }
Beispiel #3
0
 public async Task ExecuteCommandAsync(ICommand command)
 {
     using (var scope = AuthorizationCompositionRoot.BeginLifetimeScope())
     {
         var commandBus = scope.Resolve <ICommandBus>();
         await commandBus.ExecuteCommandAsync(command);
     }
 }