Skip to content

Commit

Permalink
Merge pull request #1303 from dannyBies/improve-nullability-apiresponse
Browse files Browse the repository at this point in the history
  • Loading branch information
clairernovotny authored Feb 3, 2022
2 parents 179c8b9 + 12bc255 commit 92ee888
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Refit/ApiResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down Expand Up @@ -53,6 +54,11 @@ public ApiResponse(HttpResponseMessage response, T? content, RefitSettings setti

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

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

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

0 comments on commit 92ee888

Please sign in to comment.