mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-14 01:42:55 +00:00
Added ValidateNullOrNotEmpty
This commit is contained in:
@@ -253,6 +253,17 @@ namespace CryptoExchange.Net
|
||||
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>
|
||||
/// Validates an object is not null
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user