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