We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46fe1fb commit 8587a5cCopy full SHA for 8587a5c
samples/LocalizationPlayground/CultureEnvironmentCommandLineExtensions.cs
@@ -17,12 +17,13 @@ internal static CommandLineBuilder UseCultureEnvironment(
17
!string.IsNullOrEmpty(culture))
18
CultureInfo.CurrentCulture = CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(culture);
19
20
- var execCtx = ExecutionContext.Capture();
21
-
22
await next(context).ConfigureAwait(false);
23
24
- if (context.InvocationResult is { } innerResult)
+ if (context.InvocationResult is IInvocationResult innerResult)
+ {
+ var execCtx = ExecutionContext.Capture();
25
context.InvocationResult = new ExecutionContextRestoringInvocationResult(execCtx, innerResult);
26
+ }
27
}, MiddlewareOrder.ExceptionHandler);
28
}
29
0 commit comments