internal static async Task Execute(ICommand command) { using (var scope = SchedulingCompositionRoot.BeginLifetimeScope()) { var mediator = scope.Resolve <IMediator>(); await mediator.Send(command); } }
internal static async Task <TResult> Execute <TResult>(ICommand <TResult> command) { using (var scope = SchedulingCompositionRoot.BeginLifetimeScope()) { var mediator = scope.Resolve <IMediator>(); return(await mediator.Send(command)); } }
public async Task <TResult> ExecuteQueryAsync <TResult>(IQuery <TResult> query) { using (var scope = SchedulingCompositionRoot.BeginLifetimeScope()) { var mediator = scope.Resolve <IMediator>(); return(await mediator.Send(query)); } }