Show / Hide Table of Contents

Class Validate

Provides common validation methods to simplify method parameter checks.

Inheritance
System.Object
Validate
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:Microsoft.SqlTools.ServiceLayer.Utility
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public static class Validate

Methods

| Improve this Doc View Source

IsGreaterThan(String, Int32, Int32)

Throws ArgumentOutOfRangeException if the value is less than or equal to the given lower limit.

Declaration
public static void IsGreaterThan(string parameterName, int valueToCheck, int lowerLimit)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

System.Int32 valueToCheck

The value of the parameter being validated.

System.Int32 lowerLimit

The lower limit which the value should be greater than.

| Improve this Doc View Source

IsLessThan(String, Int32, Int32)

Throws ArgumentOutOfRangeException if the value is greater than or equal to the given upper limit.

Declaration
public static void IsLessThan(string parameterName, int valueToCheck, int upperLimit)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

System.Int32 valueToCheck

The value of the parameter being validated.

System.Int32 upperLimit

The upper limit which the value should be less than.

| Improve this Doc View Source

IsNotEqual<TValue>(String, TValue, TValue)

Throws ArgumentException if the value is equal to the undesired value.

Declaration
public static void IsNotEqual<TValue>(string parameterName, TValue valueToCheck, TValue undesiredValue)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

TValue valueToCheck

The value of the parameter being validated.

TValue undesiredValue

The value that valueToCheck should not equal.

Type Parameters
Name Description
TValue The type of value to be validated.
| Improve this Doc View Source

IsNotNull(String, Object)

Throws ArgumentNullException if value is null.

Declaration
public static void IsNotNull(string parameterName, object valueToCheck)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

System.Object valueToCheck

The value of the parameter being validated.

| Improve this Doc View Source

IsNotNullOrEmptyString(String, String)

Throws ArgumentException if the value is null or an empty string.

Declaration
public static void IsNotNullOrEmptyString(string parameterName, string valueToCheck)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

System.String valueToCheck

The value of the parameter being validated.

| Improve this Doc View Source

IsNotNullOrWhitespaceString(String, String)

Throws ArgumentException if the value is null, an empty string, or a string containing only whitespace.

Declaration
public static void IsNotNullOrWhitespaceString(string parameterName, string valueToCheck)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

System.String valueToCheck

The value of the parameter being validated.

| Improve this Doc View Source

IsWithinRange(String, Int32, Int32, Int32)

Throws ArgumentOutOfRangeException if the value is outside of the given lower and upper limits.

Declaration
public static void IsWithinRange(string parameterName, int valueToCheck, int lowerLimit, int upperLimit)
Parameters
Type Name Description
System.String parameterName

The name of the parameter being validated.

System.Int32 valueToCheck

The value of the parameter being validated.

System.Int32 lowerLimit

The lower limit which the value should not be less than.

System.Int32 upperLimit

The upper limit which the value should not be greater than.

  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 Microsoft
Generated by DocFX