/// <summary> /// Creates a callback function that sends deleted object as JSON. That callack /// function call be called directly or passed as a parameter to business logic components. /// /// If object is not null it returns 200 status code. For null results it returns /// 204 status code. If error occur it sends ErrorDescription with approproate status code. /// </summary> /// <param name="response">a Http response</param> /// <param name="result">a body object to deleted result</param> protected Task SendDeletedAsync(HttpResponse response, object result) { return(HttpResponseSender.SendDeletedResultAsync(response, result)); }
/// <summary> /// Creates a callback function that sends an empty result with 204 status code. /// If error occur it sends ErrorDescription with approproate status code. /// </summary> /// <param name="response">aHttp response</param> protected Task SendEmptyResultAsync(HttpResponse response) { return(HttpResponseSender.SendEmptyResultAsync(response)); }
/// <summary> /// Sends error serialized as ErrorDescription object and appropriate HTTP status /// code.If status code is not defined, it uses 500 status code. /// </summary> /// <param name="response">a Http response</param> /// <param name="ex">an error object to be sent.</param> protected Task SendErrorAsync(HttpResponse response, Exception ex) { return(HttpResponseSender.SendErrorAsync(response, ex)); }
protected async Task SendCreatedResultAsync(HttpResponse response, object result) { await HttpResponseSender.SendCreatedResultAsync(response, result); }
protected async Task SendEmptyResultAsync(HttpResponse response) { await HttpResponseSender.SendEmptyResultAsync(response); }
protected async Task SendErrorAsync(HttpResponse response, Exception error) { await HttpResponseSender.SendErrorAsync(response, error); }