Ejemplo n.º 1
0
 /// <summary>
 /// Sends an error response
 /// </summary>
 /// <returns>An awaitable task.</returns>
 /// <param name="request">The request to respond to.</param>
 /// <param name="exception">The exception to send.</param>
 public static Task SendResponseAsync(this MRURequest request, Exception exception)
 {
     return(SendResponseAsync(request, new MRUResponse()
     {
         Success = false,
         Exception = exception
     }));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sends a response to a request
 /// </summary>
 /// <returns>An awaitable task.</returns>
 /// <param name="request">The request to respond to.</param>
 /// <param name="key">The key for the response.</param>
 /// <param name="data">The data for the response.</param>
 /// <param name="success">The success flag</param>
 public static Task SendResponseAsync(this MRURequest request, Key key, byte[] data, bool success = true)
 {
     return(SendResponseAsync(request, new MRUResponse()
     {
         Success = success,
         Data = data,
         Key = key
     }));
 }