public async Task <IActionResult> EventMiddleware(Models.QueryMiddlewareModel model, CancellationToken cancellationToken) { SampleComplexEvent @event = new SampleComplexEvent() { EventData = model.Name }; await _mediator.Dispatch(@event, cancellationToken); return(View()); }
public async Task <IActionResult> QueryMiddleware(Models.QueryMiddlewareModel model, CancellationToken cancellationToken) { SampleComplexQuery query = new SampleComplexQuery() { QueryData = model.Name }; SampleComplexQueryResponse res = await _mediator.Send(query, cancellationToken); ViewBag.Response = res.QueryResponseData; return(View()); }