mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 16:36:15 +00:00
Added ValidateNullOrNotEmpty
This commit is contained in:
parent
aba80e0699
commit
edfd16070e
@ -6,16 +6,16 @@
|
|||||||
<PackageId>CryptoExchange.Net</PackageId>
|
<PackageId>CryptoExchange.Net</PackageId>
|
||||||
<Authors>JKorf</Authors>
|
<Authors>JKorf</Authors>
|
||||||
<Description>A base package for implementing cryptocurrency exchange API's</Description>
|
<Description>A base package for implementing cryptocurrency exchange API's</Description>
|
||||||
<PackageVersion>3.8.0</PackageVersion>
|
<PackageVersion>3.8.1</PackageVersion>
|
||||||
<AssemblyVersion>3.8.0</AssemblyVersion>
|
<AssemblyVersion>3.8.0</AssemblyVersion>
|
||||||
<FileVersion>3.8.0</FileVersion>
|
<FileVersion>3.8.1</FileVersion>
|
||||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://github.com/JKorf/CryptoExchange.Net.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/JKorf/CryptoExchange.Net.git</RepositoryUrl>
|
||||||
<PackageProjectUrl>https://github.com/JKorf/CryptoExchange.Net</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/JKorf/CryptoExchange.Net</PackageProjectUrl>
|
||||||
<NeutralLanguage>en</NeutralLanguage>
|
<NeutralLanguage>en</NeutralLanguage>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<PackageReleaseNotes>3.8.0 - Better handling of json errors while deserializing stream, Added string datetime converter</PackageReleaseNotes>
|
<PackageReleaseNotes>3.8.1 - Added ValidateNullOrNotEmpty method extension</PackageReleaseNotes>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<LangVersion>8.0</LangVersion>
|
<LangVersion>8.0</LangVersion>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
|
@ -930,6 +930,13 @@
|
|||||||
<param name="value">The value of the string</param>
|
<param name="value">The value of the string</param>
|
||||||
<param name="argumentName">Name of the parameter</param>
|
<param name="argumentName">Name of the parameter</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:CryptoExchange.Net.ExtensionMethods.ValidateNullOrNotEmpty(System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
Validates a string is null or not empty
|
||||||
|
</summary>
|
||||||
|
<param name="value"></param>
|
||||||
|
<param name="argumentName"></param>
|
||||||
|
</member>
|
||||||
<member name="M:CryptoExchange.Net.ExtensionMethods.ValidateNotNull(System.Object,System.String)">
|
<member name="M:CryptoExchange.Net.ExtensionMethods.ValidateNotNull(System.Object,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
Validates an object is not null
|
Validates an object is not null
|
||||||
@ -3512,9 +3519,7 @@
|
|||||||
<member name="M:CryptoExchange.Net.Sockets.WebsocketFactory.CreateWebsocket(CryptoExchange.Net.Logging.Log,System.String,System.Collections.Generic.IDictionary{System.String,System.String},System.Collections.Generic.IDictionary{System.String,System.String})">
|
<member name="M:CryptoExchange.Net.Sockets.WebsocketFactory.CreateWebsocket(CryptoExchange.Net.Logging.Log,System.String,System.Collections.Generic.IDictionary{System.String,System.String},System.Collections.Generic.IDictionary{System.String,System.String})">
|
||||||
<inheritdoc />
|
<inheritdoc />
|
||||||
</member>
|
</member>
|
||||||
</members>
|
<member name="T:System.Diagnostics.CodeAnalysis.AllowNullAttribute">
|
||||||
</doc>
|
|
||||||
System.Diagnostics.CodeAnalysis.AllowNullAttribute">
|
|
||||||
<summary>
|
<summary>
|
||||||
Specifies that <see langword="null"/> is allowed as an input even if the
|
Specifies that <see langword="null"/> is allowed as an input even if the
|
||||||
corresponding type disallows it.
|
corresponding type disallows it.
|
||||||
|
@ -253,6 +253,17 @@ namespace CryptoExchange.Net
|
|||||||
throw new ArgumentException($"No value provided for parameter {argumentName}", argumentName);
|
throw new ArgumentException($"No value provided for parameter {argumentName}", argumentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Validates a string is null or not empty
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="argumentName"></param>
|
||||||
|
public static void ValidateNullOrNotEmpty(this string value, string argumentName)
|
||||||
|
{
|
||||||
|
if (value != null && string.IsNullOrEmpty(value))
|
||||||
|
throw new ArgumentException($"No value provided for parameter {argumentName}", argumentName);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Validates an object is not null
|
/// Validates an object is not null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user