Class ArgumentHelper
Defines a static helper class that provides methods for simplifying common argument operations such as null-checking and value validations. These helper methods enable replacing of repetitive code blocks with one-liners.
Inheritance
System.Object
ArgumentHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Juhta.Net.Helpers
Assembly: Juhta.Net.dll
Syntax
public static class ArgumentHelper
Methods
| Improve this Doc View SourceCheckNull(String, Object)
Checks whether a parameter value is null, and if so, throws an System.ArgumentNullException.
Declaration
public static void CheckNull(string paramName, object paramValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | paramName | Specifies a parameter name. |
System.Object | paramValue | Specifies a parameter value. |
CheckValue(String, String, String)
Checks whether a parameter value conforms to a regex pattern, and if it doesn't, throws an System.ArgumentException.
Declaration
public static void CheckValue(string paramName, string paramValue, string regexPattern)
Parameters
Type | Name | Description |
---|---|---|
System.String | paramName | Specifies a parameter name. |
System.String | paramValue | Specifies a parameter value. |
System.String | regexPattern | Specifies a regex pattern. |