예제 #1
0
 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());
 }
예제 #2
0
        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);
        }