Class Validator
Contains validation methods
Inheritance
System.Object
Validator
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Data
Assembly: EPiServer.Data.dll
Version: 8.11.0Syntax
public static class Validator
Methods
ValidateArgNotNull(String, Object)
Validates that an argument passed to a method is not null
Declaration
public static void ValidateArgNotNull(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the argument to validate |
System.Object | value | The value of the argument to validate |
ValidateArgNotNullOrEmpty(String, String)
Validates that a System.String passed to a method is not null or System.String.Empty.
Declaration
public static void ValidateArgNotNullOrEmpty(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the argument to validate |
System.String | value | The value of the argument to validate |
ValidateForInvalidSqlIdentifier(IEnumerable<String>)
Declaration
public static void ValidateForInvalidSqlIdentifier(IEnumerable<string> identifiers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | identifiers |
ValidateForSqlInjection(StoreDefinitionParameters)
Declaration
public static void ValidateForSqlInjection(StoreDefinitionParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
StoreDefinitionParameters | parameters |
ValidateForSqlInjection(String, String)
Validates that a System.String passed to a method does not contain SQL injection code
Declaration
public static void ValidateForSqlInjection(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the argument to validate |
System.String | value | The value of the argument to validate |
ValidateLength(String, String, Int32, Int32)
Declaration
public static void ValidateLength(string name, string value, int minLength, int maxLength)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.String | value | |
System.Int32 | minLength | |
System.Int32 | maxLength |
ValidateNotReadOnly(IReadOnly)
Throws an exception if the instance is read-only
Declaration
public static void ValidateNotReadOnly(IReadOnly readOnly)
Parameters
Type | Name | Description |
---|---|---|
IReadOnly | readOnly | The instance that is being validated |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException |