-
Notifications
You must be signed in to change notification settings - Fork 20
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
7 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
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,12 @@ | ||
using System; | ||
|
||
namespace SslCertBinding.Net | ||
{ | ||
internal static class ArgumentValidation | ||
{ | ||
public static T ThrowIfNull<T>(this T arg, string paramName) where T : class | ||
{ | ||
return arg is null ? throw new ArgumentNullException(paramName) : arg; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
using System.Net; | ||
using System; | ||
using System.Net; | ||
|
||
namespace SslCertBinding.Net | ||
{ | ||
public static class BindingEndPointExtentions | ||
{ | ||
public static BindingEndPoint ToBindingEndPoint(this IPEndPoint ipEndPoint) => ipEndPoint.ToBindingEndPoint(); | ||
public static BindingEndPoint ToBindingEndPoint(this IPEndPoint ipEndPoint) => new BindingEndPoint(ipEndPoint); | ||
public static BindingEndPoint ToBindingEndPoint(this DnsEndPoint dnsEndPoint) => dnsEndPoint as BindingEndPoint ?? new BindingEndPoint(dnsEndPoint); | ||
public static DnsEndPoint ToDnsEndPoint(this IPEndPoint ipEndPoint) => ipEndPoint.ToBindingEndPoint(); | ||
public static IPEndPoint ToIPEndPoint(this DnsEndPoint dnsEndPoint) => dnsEndPoint.ToBindingEndPoint().ToIPEndPoint(); | ||
public static DnsEndPoint ToDnsEndPoint(this IPEndPoint ipEndPoint) => ipEndPoint.ThrowIfNull(nameof(ipEndPoint)).ToBindingEndPoint(); | ||
public static IPEndPoint ToIPEndPoint(this DnsEndPoint dnsEndPoint) => dnsEndPoint.ThrowIfNull(nameof(dnsEndPoint)).ToBindingEndPoint().ToIPEndPoint(); | ||
} | ||
} |
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