-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing I*HttpResult
interfaces
#42385
Introducing I*HttpResult
interfaces
#42385
Conversation
src/Http/Http.Abstractions/src/HttpResults/IContentTypeHttpResult.cs
Outdated
Show resolved
Hide resolved
…ult.cs Co-authored-by: Martin Costello <martin@martincostello.com>
|
||
/// <summary> | ||
/// Defines a contract that represents the result of an HTTP endpoint | ||
/// that contains a nested <see cref="IResult"/> type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a remark about the Result<T1, T2>
type?
@@ -37,7 +41,7 @@ internal ProblemHttpResult(ProblemDetails problemDetails) | |||
/// <summary> | |||
/// Gets the HTTP status code. | |||
/// </summary> | |||
public int? StatusCode => ProblemDetails.Status; | |||
public int StatusCode => ProblemDetails.Status!.Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check for null and use a default status code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set the default in the constructor, and it will not be null
if (problemDetails.Status is null) |
But sure, I can add a check if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Close #42187