Skip to content

Commit 664b5fd

Browse files
authored
net8.0 target follow up (Azure#47214)
1 parent 173217a commit 664b5fd

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/src/AuthenticationEventBinding.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ private static IReadOnlyDictionary<string, Type> GetBindingDataContract(Paramete
8686
public async Task<ITriggerData> BindAsync(object value, ValueBindingContext context)
8787
{
8888
var request = (HttpRequestMessage)value;
89+
#if NET8_0_OR_GREATER
90+
HttpRequestOptionsKey<WebJobsAuthenticationEventResponseHandler> httpRequestOptionsKey = new(WebJobsAuthenticationEventResponseHandler.EventResponseProperty);
91+
request.Options.TryGetValue(httpRequestOptionsKey, out WebJobsAuthenticationEventResponseHandler eventResponseHandler);
92+
#else
8993
WebJobsAuthenticationEventResponseHandler eventResponseHandler =
9094
(WebJobsAuthenticationEventResponseHandler)request.Properties[WebJobsAuthenticationEventResponseHandler.EventResponseProperty];
95+
#endif
9196
try
9297
{
9398
if (request == null)

sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/src/AuthenticationEventConfigProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ public async Task<HttpResponseMessage> ConvertAsync(HttpRequestMessage input, Ca
109109
//We create an event response handler and attach it to the income HTTP message, then on the trigger we set the function response
110110
//in the event response handler and after the executor calls the functions we have reference to the function response.
111111
WebJobsAuthenticationEventResponseHandler eventsResponseHandler = new WebJobsAuthenticationEventResponseHandler();
112+
#if NET8_0_OR_GREATER
113+
HttpRequestOptionsKey<WebJobsAuthenticationEventResponseHandler> httpRequestOptionsKey = new(WebJobsAuthenticationEventResponseHandler.EventResponseProperty);
114+
input.Options.Set(httpRequestOptionsKey, eventsResponseHandler);
115+
#else
112116
input.Properties.Add(WebJobsAuthenticationEventResponseHandler.EventResponseProperty, eventsResponseHandler);
117+
#endif
113118

114119
TriggeredFunctionData triggerData = new TriggeredFunctionData()
115120
{

sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Listeners/BlobQueueTriggerExecutor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,16 @@ public async Task<FunctionResult> ExecuteAsync(QueueMessage value, CancellationT
115115
// Include the queue details here.
116116
IDictionary<string, string> details = PopulateTriggerDetails(value);
117117

118+
#pragma warning disable CS8073 // The result of the expression is always true in net8.0, but not this is not true in netstandard2.0
118119
if (blobProperties.CreatedOn != null)
120+
#pragma warning restore CS8073
119121
{
120122
details[BlobCreatedKey] = blobProperties.CreatedOn.ToString(Constants.DateTimeFormatString, CultureInfo.InvariantCulture);
121123
}
122124

125+
#pragma warning disable CS8073 // The result of the expression is always true in net8.0, but not this is not true in netstandard2.0
123126
if (blobProperties.LastModified != null)
127+
#pragma warning restore CS8073
124128
{
125129
details[BlobLastModifiedKey] = blobProperties.LastModified.ToString(Constants.DateTimeFormatString, CultureInfo.InvariantCulture);
126130
}

0 commit comments

Comments
 (0)