-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
59 additions
and
41 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/RestClient/RestClient/src/ClickView.Extensions.RestClient.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 17 additions & 18 deletions
35
src/RestClient/RestClient/src/Extensions/HttpHeadersExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
namespace ClickView.Extensions.RestClient.Extensions | ||
{ | ||
using System.Net.Http.Headers; | ||
namespace ClickView.Extensions.RestClient.Extensions; | ||
|
||
using System.Net.Http.Headers; | ||
|
||
public static class HttpHeadersExtensions | ||
public static class HttpHeadersExtensions | ||
{ | ||
public static bool TryGetFirstHeaderValue(this HttpHeaders headers, string name, out string? value) | ||
{ | ||
public static bool TryGetFirstHeaderValue(this HttpHeaders headers, string name, out string value) | ||
if (!headers.TryGetValues(name, out var values)) | ||
{ | ||
if (!headers.TryGetValues(name, out var values)) | ||
{ | ||
value = null; | ||
return false; | ||
} | ||
|
||
if (!values.TryGetFirstValue(out var first)) | ||
{ | ||
value = null; | ||
return false; | ||
} | ||
value = null; | ||
return false; | ||
} | ||
|
||
value = first; | ||
return true; | ||
if (!values.TryGetFirstValue(out var first)) | ||
{ | ||
value = null; | ||
return false; | ||
} | ||
|
||
value = first; | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#if NETFRAMEWORK | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
using System; | ||
|
||
internal sealed class NotNullWhenAttribute : Attribute | ||
{ | ||
/// <summary>Initializes the attribute with the specified return value condition.</summary> | ||
/// <param name="returnValue"> | ||
/// The return value condition. If the method returns this value, the associated parameter will not be null. | ||
/// </param> | ||
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; | ||
|
||
/// <summary>Gets the return value condition.</summary> | ||
public bool ReturnValue { get; } | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters