Class InValuesValidator
Represents a validator that validates that a field value is in a predefined set of values.
Inheritance
System.Object
InValuesValidator
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:Contentful.Core.Models.Management
Assembly:cs.temp.dll.dll
Syntax
public class InValuesValidator : IFieldValidator
Constructors
InValuesValidator(IEnumerable<String>, String)
Initializes a new instance of InValuesValidator
Declaration
public InValuesValidator(IEnumerable<string> requiredValues, string message = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | requiredValues | The values to validate the field value against. |
System.String | message | The custom error message for this validation. |
InValuesValidator(String, String[])
Initializes a new instance of InValuesValidator
Declaration
public InValuesValidator(string message = null, params string[] requiredValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The custom error message for this validation. |
System.String[] | requiredValues | The values to validate the field value against. |
Properties
Message
The custom error message that should be displayed.
Declaration
public string Message { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RequiredValues
The list of values to compare the field value to.
Declaration
public List<string> RequiredValues { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
Methods
CreateValidator()
Creates a representation of this validator that can be easily serialized.
Declaration
public object CreateValidator()
Returns
Type | Description |
---|---|
System.Object | The object to serialize. |