예제 #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));
     }
 }
예제 #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));
     }
 }
예제 #3
0
 public async Task ExecuteCommandAsync(ICommand command)
 {
     using (var scope = AuthorizationCompositionRoot.BeginLifetimeScope())
     {
         var commandBus = scope.Resolve <ICommandBus>();
         await commandBus.ExecuteCommandAsync(command);
     }
 }