예제 #1
0
 internal static async Task Execute(ICommand command)
 {
     using (var scope = ProductsCompositionRoot.BeginLifetimeScope())
     {
         var mediator = scope.Resolve <IMediator>();
         await mediator.Send(command);
     }
 }
예제 #2
0
 internal static async Task <TResult> Execute <TResult>(ICommand <TResult> command)
 {
     using (var scope = ProductsCompositionRoot.BeginLifetimeScope())
     {
         var mediator = scope.Resolve <IMediator>();
         return(await mediator.Send(command));
     }
 }