-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
First, thank you so much for putting this example out there. Very helpful.
You may already be aware but with a new update of the SDK reflection isn't necessary anymore in FunctionContextExtensions.cs:
public static void SetHttpResponseStatusCode(
this FunctionContext context,
HttpStatusCode statusCode)
{
var httpReqData = context.GetHttpRequestDataAsync().GetAwaiter().GetResult();
if (httpReqData != null)
{
var newResponse = httpReqData.CreateResponse();
newResponse.StatusCode = statusCode;
// Update invocation result.
context.GetInvocationResult().Value = newResponse;
}
return;
}
The above should be a drop in replacement for your original code w/ reflection. azure-functions-dotnet-worker issue/comment. You will need to upgrade the SDK to Version 1.8.0-preview3.
reza8iucs, andimarj and oleks9o6
Metadata
Metadata
Assignees
Labels
No labels