public string Handle(QuerySomethingWithDelay query) { return(Task.Delay(query.DelayInMilliseconds).ContinueWith(t => { base.HandleAsync <QuerySomethingWithDelay, string>(query); TestOutputHelper.WriteLine($"Query result: {query.Data}."); return query.Data; }).GetAwaiter().GetResult()); }
public async Task <string> HandleAsync(QuerySomethingWithDelay query, CancellationToken cancellationToken = default(CancellationToken)) { base.HandleAsync <QuerySomethingWithDelay, string>(query); await Task.Delay(query.DelayInMilliseconds, cancellationToken); TestOutputHelper.WriteLine($"Query result: {query.Data}."); return(query.Data); }