Skip to content

Commit

Permalink
Keep status correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Romout committed Mar 21, 2024
1 parent 06bb354 commit c22347a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public partial class {{ Class }}Controller : {% if HasBaseClass %}{{ BaseClass }
var result = await _implementation.{{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.VariableName }}{% if parameter.HasDefault %} ?? {{parameter.Default}}{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}cancellationToken{% endif %}).ConfigureAwait(false);

var status = (System.Net.HttpStatusCode)result.StatusCode;
HttpResponseMessage response = Request.CreateResponse(status{% if operation.UnwrappedResultType != "void" %}, result.Result{% endif %});
HttpResponseMessage response = Request.CreateResponse(status{% if operation.UnwrappedResultType != "void" %}, result.Result{% else %}, (object)null{% endif %});

foreach (var header in result.Headers)
response.Headers.Add(header.Key, header.Value);
Expand Down

0 comments on commit c22347a

Please sign in to comment.