1
0

Optimizing async tasks (ConfigureAwait(false))

This commit is contained in:
2023-11-03 10:12:30 +01:00
parent 18b9627ea4
commit ca76966827
11 changed files with 61 additions and 43 deletions

View File

@@ -37,14 +37,14 @@ namespace AMWD.Common.AspNetCore.Security.PathProtection
{
if (httpContext.Request.Path.StartsWithSegments(path))
{
var result = await authorizationService.AuthorizeAsync(httpContext.User, null, policyName);
var result = await authorizationService.AuthorizeAsync(httpContext.User, null, policyName).ConfigureAwait(false);
if (!result.Succeeded)
{
await httpContext.ChallengeAsync();
await httpContext.ChallengeAsync().ConfigureAwait(false);
return;
}
}
await next.Invoke(httpContext);
await next.Invoke(httpContext).ConfigureAwait(false);
}
}
}