protected async Task <TResult> ExecuteCommandAsync <TData, TResult>(string name, TData data = default, TimeSpan?timeout = null) { var command = MessageFactory.CreateCommand(name, data); var response = await QuikClient.SendAsync <IResult <TResult> >(command, timeout).ConfigureAwait(false); return(response.Data); }
/// <inheritdoc/> public async Task <string> PingAsync() { // could have used StringMessage directly. This is an example of how to define DTOs for custom commands var command = new PingRequest(); var result = await QuikClient.SendAsync <PingResponse>(command).ConfigureAwait(false); Trace.Assert(result.Data == "Pong"); return(result.Data); }