Closed maxsenft closed 2 years ago
When assigning a function to ProblemDetailsOptions.GetTraceId() which always returns null, the code analyzer throws warning CS8621.
I guess a ? should be added after string in the line
?
string
https://github.com/khellang/Middleware/blob/56e449388894e529102cce11002f9cf19f20596b/src/ProblemDetails/ProblemDetailsOptions.cs#L58
So it should look like this:
public Func<HttpContext, string?> GetTraceId { get; set; } = null!;
This should also be reasonable since the result after invoking the function is checked for null:
https://github.com/khellang/Middleware/blob/56e449388894e529102cce11002f9cf19f20596b/src/ProblemDetails/ProblemDetailsOptions.cs#L291-L293
Sounds reasonable to me. Wanna send a PR? πΌπ»
Closed with #169. Pushed v6.4.1 to NuGet π
When assigning a function to ProblemDetailsOptions.GetTraceId() which always returns null, the code analyzer throws warning CS8621.
I guess a
?
should be added afterstring
in the linehttps://github.com/khellang/Middleware/blob/56e449388894e529102cce11002f9cf19f20596b/src/ProblemDetails/ProblemDetailsOptions.cs#L58
So it should look like this:
This should also be reasonable since the result after invoking the function is checked for null:
https://github.com/khellang/Middleware/blob/56e449388894e529102cce11002f9cf19f20596b/src/ProblemDetails/ProblemDetailsOptions.cs#L291-L293