1
0
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:
Zebio21
2021-04-18 14:36:17 +11:00
parent aba80e0699
commit edfd16070e
3 changed files with 22 additions and 6 deletions
+11
View File
@@ -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>