Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
588 lines (566 sloc) 38.1 KB
<Type Name="ValidationAttribute" FullName="System.ComponentModel.DataAnnotations.ValidationAttribute">
<TypeSignature Language="C#" Value="public abstract class ValidationAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit ValidationAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:System.ComponentModel.DataAnnotations.ValidationAttribute" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class ValidationAttribute&#xA;Inherits Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class ValidationAttribute abstract : Attribute" />
<TypeSignature Language="F#" Value="type ValidationAttribute = class&#xA; inherit Attribute" />
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Serves as the base class for all validation attributes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This class enforces validation, based on the metadata that is associated with the data table. You can override this class to create custom validation attributes.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.DataAnnotations.ValidationException">The <see cref="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType" /> and <see cref="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceName" /> properties for localized error message are set at the same time that the non-localized <see cref="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessage" /> property error message is set.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/ef99e518-f112-4797-bf9c-79f4ceb466ea">How to: Customize Data Field Validation in the Data Model Using Custom Attributes</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.ValidationAttribute" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected ValidationAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; ValidationAttribute();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.ValidationAttribute" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected ValidationAttribute (Func&lt;string&gt; errorMessageAccessor);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Func`1&lt;string&gt; errorMessageAccessor) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.#ctor(System.Func{System.String})" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (errorMessageAccessor As Func(Of String))" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; ValidationAttribute(Func&lt;System::String ^&gt; ^ errorMessageAccessor);" />
<MemberSignature Language="F#" Value="new System.ComponentModel.DataAnnotations.ValidationAttribute : Func&lt;string&gt; -&gt; System.ComponentModel.DataAnnotations.ValidationAttribute" Usage="new System.ComponentModel.DataAnnotations.ValidationAttribute errorMessageAccessor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="errorMessageAccessor" Type="System.Func&lt;System.String&gt;" />
</Parameters>
<Docs>
<param name="errorMessageAccessor">The function that enables access to validation resources.</param>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.ValidationAttribute" /> class by using the function that enables access to validation resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor provides a resource accessor function that is used by the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageString%2A> property to retrieve an error message.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="errorMessageAccessor" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected ValidationAttribute (string errorMessage);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(string errorMessage) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (errorMessage As String)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; ValidationAttribute(System::String ^ errorMessage);" />
<MemberSignature Language="F#" Value="new System.ComponentModel.DataAnnotations.ValidationAttribute : string -&gt; System.ComponentModel.DataAnnotations.ValidationAttribute" Usage="new System.ComponentModel.DataAnnotations.ValidationAttribute errorMessage" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="errorMessage" Type="System.String" />
</Parameters>
<Docs>
<param name="errorMessage">The error message to associate with a validation control.</param>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.ValidationAttribute" /> class by using the error message to associate with a validation control.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ErrorMessage">
<MemberSignature Language="C#" Value="public string ErrorMessage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ErrorMessage" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessage" />
<MemberSignature Language="VB.NET" Value="Public Property ErrorMessage As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ErrorMessage { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ErrorMessage : string with get, set" Usage="System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessage" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an error message to associate with a validation control if validation fails.</summary>
<value>The error message that is associated with the validation control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is the error message that you associate with the validation control. It is used for non-localized error messages.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ErrorMessageResourceName">
<MemberSignature Language="C#" Value="public string ErrorMessageResourceName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ErrorMessageResourceName" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceName" />
<MemberSignature Language="VB.NET" Value="Public Property ErrorMessageResourceName As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ErrorMessageResourceName { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ErrorMessageResourceName : string with get, set" Usage="System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the error message resource name to use in order to look up the <see cref="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType" /> property value if validation fails.</summary>
<value>The error message resource that is associated with a validation control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You use the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceName%2A> property together with the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType%2A> property in order to provide a localized error message.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ErrorMessageResourceType">
<MemberSignature Language="C#" Value="public Type ErrorMessageResourceType { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Type ErrorMessageResourceType" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType" />
<MemberSignature Language="VB.NET" Value="Public Property ErrorMessageResourceType As Type" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Type ^ ErrorMessageResourceType { Type ^ get(); void set(Type ^ value); };" />
<MemberSignature Language="F#" Value="member this.ErrorMessageResourceType : Type with get, set" Usage="System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Type</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the resource type to use for error-message lookup if validation fails.</summary>
<value>The type of error message that is associated with a validation control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You use the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType%2A> property together with the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceName%2A> property in to provide a localized error message.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ErrorMessageString">
<MemberSignature Language="C#" Value="protected string ErrorMessageString { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ErrorMessageString" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageString" />
<MemberSignature Language="VB.NET" Value="Protected ReadOnly Property ErrorMessageString As String" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; property System::String ^ ErrorMessageString { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.ErrorMessageString : string" Usage="System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageString" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the localized validation error message.</summary>
<value>The localized validation error message.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The error message string is obtained by evaluating the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessage%2A> property or by evaluating the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceType%2A> and <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageResourceName%2A> properties. The two cases are mutually exclusive. The second case is used if you want to display a localized error message.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="FormatErrorMessage">
<MemberSignature Language="C#" Value="public virtual string FormatErrorMessage (string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string FormatErrorMessage(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.FormatErrorMessage(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function FormatErrorMessage (name As String) As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ FormatErrorMessage(System::String ^ name);" />
<MemberSignature Language="F#" Value="abstract member FormatErrorMessage : string -&gt; string&#xA;override this.FormatErrorMessage : string -&gt; string" Usage="validationAttribute.FormatErrorMessage name" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The name to include in the formatted message.</param>
<summary>Applies formatting to an error message, based on the data field where the error occurred.</summary>
<returns>An instance of the formatted error message.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method formats an error message by using the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.ErrorMessageString%2A> property. This method appends the name of the data field that triggered the error to the formatted error message. You can customize how the error message is formatted by creating a derived class that overrides this method.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetValidationResult">
<MemberSignature Language="C#" Value="public System.ComponentModel.DataAnnotations.ValidationResult GetValidationResult (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.ComponentModel.DataAnnotations.ValidationResult GetValidationResult(object value, class System.ComponentModel.DataAnnotations.ValidationContext validationContext) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.GetValidationResult(System.Object,System.ComponentModel.DataAnnotations.ValidationContext)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::ComponentModel::DataAnnotations::ValidationResult ^ GetValidationResult(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);" />
<MemberSignature Language="F#" Value="member this.GetValidationResult : obj * System.ComponentModel.DataAnnotations.ValidationContext -&gt; System.ComponentModel.DataAnnotations.ValidationResult" Usage="validationAttribute.GetValidationResult (value, validationContext)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.DataAnnotations.ValidationResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="validationContext" Type="System.ComponentModel.DataAnnotations.ValidationContext" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="value">The value to validate.</param>
<param name="validationContext">The context information about the validation operation.</param>
<summary>Checks whether the specified value is valid with respect to the current validation attribute.</summary>
<returns>An instance of the <see cref="T:System.ComponentModel.DataAnnotations.ValidationResult" /> class.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.GetValidationResult%2A> method checks validity without throwing an exception.
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.DataAnnotations.ValidationResult" />
</Docs>
</Member>
<MemberGroup MemberName="IsValid">
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Checks whether the specified object is valid.</summary>
</Docs>
</MemberGroup>
<Member MemberName="IsValid">
<MemberSignature Language="C#" Value="public virtual bool IsValid (object value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool IsValid(object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function IsValid (value As Object) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool IsValid(System::Object ^ value);" />
<MemberSignature Language="F#" Value="abstract member IsValid : obj -&gt; bool&#xA;override this.IsValid : obj -&gt; bool" Usage="validationAttribute.IsValid value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">The value of the object to validate.</param>
<summary>Determines whether the specified value of the object is valid.</summary>
<returns>
<see langword="true" /> if the specified value is valid; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you inherit from the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute> class, you must implement the validation logic in this method.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsValid">
<MemberSignature Language="C#" Value="protected virtual System.ComponentModel.DataAnnotations.ValidationResult IsValid (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.ComponentModel.DataAnnotations.ValidationResult IsValid(object value, class System.ComponentModel.DataAnnotations.ValidationContext validationContext) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object,System.ComponentModel.DataAnnotations.ValidationContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::ComponentModel::DataAnnotations::ValidationResult ^ IsValid(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);" />
<MemberSignature Language="F#" Value="abstract member IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -&gt; System.ComponentModel.DataAnnotations.ValidationResult&#xA;override this.IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -&gt; System.ComponentModel.DataAnnotations.ValidationResult" Usage="validationAttribute.IsValid (value, validationContext)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.DataAnnotations.ValidationResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="validationContext" Type="System.ComponentModel.DataAnnotations.ValidationContext" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="value">The value to validate.</param>
<param name="validationContext">The context information about the validation operation.</param>
<summary>Validates the specified value with respect to the current validation attribute.</summary>
<returns>An instance of the <see cref="T:System.ComponentModel.DataAnnotations.ValidationResult" /> class.</returns>
<remarks>To be added.</remarks>
<altmember cref="T:System.ComponentModel.DataAnnotations.ValidationResult" />
</Docs>
</Member>
<Member MemberName="RequiresValidationContext">
<MemberSignature Language="C#" Value="public virtual bool RequiresValidationContext { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool RequiresValidationContext" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.ValidationAttribute.RequiresValidationContext" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property RequiresValidationContext As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool RequiresValidationContext { bool get(); };" />
<MemberSignature Language="F#" Value="member this.RequiresValidationContext : bool" Usage="System.ComponentModel.DataAnnotations.ValidationAttribute.RequiresValidationContext" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the attribute requires validation context.</summary>
<value>
<see langword="true" /> if the attribute requires validation context; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Validate">
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Validates the specified object.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Validate">
<MemberSignature Language="C#" Value="public void Validate (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Validate(object value, class System.ComponentModel.DataAnnotations.ValidationContext validationContext) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.Validate(System.Object,System.ComponentModel.DataAnnotations.ValidationContext)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Validate(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);" />
<MemberSignature Language="F#" Value="member this.Validate : obj * System.ComponentModel.DataAnnotations.ValidationContext -&gt; unit" Usage="validationAttribute.Validate (value, validationContext)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="validationContext" Type="System.ComponentModel.DataAnnotations.ValidationContext" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="value">The object to validate.</param>
<param name="validationContext">The <see cref="T:System.ComponentModel.DataAnnotations.ValidationContext" /> object that describes the context where the validation checks are performed. This parameter cannot be <see langword="null" />.</param>
<summary>Validates the specified object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method calls the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid%2A> method to determine whether the object that is specified by the `value` parameter is valid. If the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.Validate%2A> method returns `false`, this method calls the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.FormatErrorMessage%2A> method to get a localized message that states the problem. It then throws a <xref:System.ComponentModel.DataAnnotations.ValidationException> exception.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.DataAnnotations.ValidationException">Validation failed.</exception>
</Docs>
</Member>
<Member MemberName="Validate">
<MemberSignature Language="C#" Value="public void Validate (object value, string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Validate(object value, string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ValidationAttribute.Validate(System.Object,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Validate (value As Object, name As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Validate(System::Object ^ value, System::String ^ name);" />
<MemberSignature Language="F#" Value="member this.Validate : obj * string -&gt; unit" Usage="validationAttribute.Validate (value, name)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="value">The value of the object to validate.</param>
<param name="name">The name to include in the error message.</param>
<summary>Validates the specified object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method validates the value of the object or property on which the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute> attribute is declared. It calls the <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid%2A> method and passes `value` as a parameter. If validation fails, a <xref:System.ComponentModel.DataAnnotations.ValidationException> exception is thrown.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.DataAnnotations.ValidationException">
<paramref name="value" /> is not valid.</exception>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.