Show / Hide Table of Contents

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 Source

CheckNull(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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX