Show / Hide Table of Contents

Class Guard

Provides common validation methods shared across the framework entities. This class cannot be inherited.

Inheritance
System.Object
Guard
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: Argotic.Common
Assembly: Argotic.Common.dll
Syntax
public static class Guard

Methods

| Improve this Doc View Source

ArgumentNotGreaterThan(Decimal, String, Decimal)

Validates that the supplied value is not greater than the specified maximum.

Declaration
public static void ArgumentNotGreaterThan(decimal value, string name, decimal maximum)
Parameters
Type Name Description
System.Decimal value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Decimal maximum

The maximum acceptable value.

Remarks

If the value is greater than the specified maximum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotGreaterThan(Int32, String, Int32)

Validates that the supplied value is not greater than the specified maximum.

Declaration
public static void ArgumentNotGreaterThan(int value, string name, int maximum)
Parameters
Type Name Description
System.Int32 value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int32 maximum

The maximum acceptable value.

Remarks

If the value is greater than the specified maximum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotGreaterThan(Int64, String, Int64)

Validates that the supplied value is not greater than the specified maximum.

Declaration
public static void ArgumentNotGreaterThan(long value, string name, long maximum)
Parameters
Type Name Description
System.Int64 value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int64 maximum

The maximum acceptable value.

Remarks

If the value is greater than the specified maximum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotLessThan(Decimal, String, Decimal)

Validates that the supplied value is not less than the specified minimum.

Declaration
public static void ArgumentNotLessThan(decimal value, string name, decimal minimum)
Parameters
Type Name Description
System.Decimal value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Decimal minimum

The minimum acceptable value.

Remarks

If the value is less than the specified minimum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotLessThan(Int32, String, Int32)

Validates that the supplied value is not less than the specified minimum.

Declaration
public static void ArgumentNotLessThan(int value, string name, int minimum)
Parameters
Type Name Description
System.Int32 value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int32 minimum

The minimum acceptable value.

Remarks

If the value is less than the specified minimum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotLessThan(Int64, String, Int64)

Validates that the supplied value is not less than the specified minimum.

Declaration
public static void ArgumentNotLessThan(long value, string name, long minimum)
Parameters
Type Name Description
System.Int64 value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int64 minimum

The minimum acceptable value.

Remarks

If the value is less than the specified minimum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotNull(Object, String)

Validates that the supplied value is not a null reference.

Declaration
public static void ArgumentNotNull(object value, string name)
Parameters
Type Name Description
System.Object value

The value of the method argument to validate.

System.String name

The name of the method argument.

Remarks

If the value is a null reference, an System.ArgumentNullException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotNullOrEmptyString(String, String)

Validates that the supplied value is not a null reference or an empty string.

Declaration
public static void ArgumentNotNullOrEmptyString(string value, string name)
Parameters
Type Name Description
System.String value

The value of the method argument to validate.

System.String name

The name of the method argument.

Remarks

If the value is a null reference or an empty string, an System.ArgumentNullException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotOutOfRange(Decimal, String, Int32, Decimal)

Validates that the supplied value is within the specified range.

Declaration
public static void ArgumentNotOutOfRange(decimal value, string name, int minimum, decimal maximum)
Parameters
Type Name Description
System.Decimal value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int32 minimum

The minimum acceptable value of the range.

System.Decimal maximum

The maximum acceptable value of the range.

Remarks

If the value is less than the specified minimum or greater than the specified maximum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotOutOfRange(Int32, String, Int32, Int32)

Validates that the supplied value is within the specified range.

Declaration
public static void ArgumentNotOutOfRange(int value, string name, int minimum, int maximum)
Parameters
Type Name Description
System.Int32 value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int32 minimum

The minimum acceptable value of the range.

System.Int32 maximum

The maximum acceptable value of the range.

Remarks

If the value is less than the specified minimum or greater than the specified maximum, an System.ArgumentOutOfRangeException is raised using the supplied name.

| Improve this Doc View Source

ArgumentNotOutOfRange(Int64, String, Int32, Int64)

Validates that the supplied value is within the specified range.

Declaration
public static void ArgumentNotOutOfRange(long value, string name, int minimum, long maximum)
Parameters
Type Name Description
System.Int64 value

The value of the method argument to validate.

System.String name

The name of the method argument.

System.Int32 minimum

The minimum acceptable value of the range.

System.Int64 maximum

The maximum acceptable value of the range.

Remarks

If the value is less than the specified minimum or greater than the specified maximum, an System.ArgumentOutOfRangeException is raised using the supplied name.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX