Skip to content

Commit

Permalink
Add MemberNotNullWhen attribute to IsSuccessStatusCode
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyBies authored Feb 3, 2022
1 parent 179c8b9 commit 48dda1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Refit/ApiResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public ApiResponse(HttpResponseMessage response, T? content, RefitSettings setti

public HttpContentHeaders? ContentHeaders => response.Content?.Headers;

#if NET5_0_OR_GREATER
[MemberNotNullWhen(true, nameof(Content))]
[MemberNotNullWhen(false, nameof(Error))]
#endif
public bool IsSuccessStatusCode => response.IsSuccessStatusCode;

public string? ReasonPhrase => response.ReasonPhrase;
Expand Down

0 comments on commit 48dda1f

Please sign in to comment.