forked from dotnet/dotnet-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomValidationAttribute.xml
348 lines (333 loc) · 22.9 KB
/
CustomValidationAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<Type Name="CustomValidationAttribute" FullName="System.ComponentModel.DataAnnotations.CustomValidationAttribute">
<TypeSignature Language="C#" Value="public sealed class CustomValidationAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit CustomValidationAttribute extends System.ComponentModel.DataAnnotations.ValidationAttribute" />
<TypeSignature Language="DocId" Value="T:System.ComponentModel.DataAnnotations.CustomValidationAttribute" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class CustomValidationAttribute
Inherits ValidationAttribute" />
<TypeSignature Language="F#" Value="type CustomValidationAttribute = class
 inherit ValidationAttribute" />
<TypeSignature Language="C++ CLI" Value="public ref class CustomValidationAttribute sealed : System::ComponentModel::DataAnnotations::ValidationAttribute" />
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.ComponentModel.DataAnnotations" FromVersion="4.0.0.0" To="System.ComponentModel.Annotations" ToVersion="0.0.0.0" FrameworkAlternate="dotnet-uwp-10.0;netcore-2.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.ComponentModel.DataAnnotations.ValidationAttribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=true)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=true)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Specifies a custom validation method that is used to validate a property or class instance.</summary>
<remarks>
<format type="text/markdown"><.
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CustomValidationAttribute (Type validatorType, string method);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type validatorType, string method) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.CustomValidationAttribute.#ctor(System.Type,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (validatorType As Type, method As String)" />
<MemberSignature Language="F#" Value="new System.ComponentModel.DataAnnotations.CustomValidationAttribute : Type * string -> System.ComponentModel.DataAnnotations.CustomValidationAttribute" Usage="new System.ComponentModel.DataAnnotations.CustomValidationAttribute (validatorType, method)" />
<MemberSignature Language="C++ CLI" Value="public:
 CustomValidationAttribute(Type ^ validatorType, System::String ^ method);" />
<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>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="validatorType" Type="System.Type">
<Attributes>
<Attribute FrameworkAlternate="net-6.0;net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]</AttributeName>
<AttributeName Language="F#">[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="method" Type="System.String" />
</Parameters>
<Docs>
<param name="validatorType">The type that contains the method that performs custom validation.</param>
<param name="method">The method that performs custom validation.</param>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.CustomValidationAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method specifies a custom class and a related method to call at run time in order to execute custom validation logic.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="FormatErrorMessage">
<MemberSignature Language="C#" Value="public override string FormatErrorMessage (string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string FormatErrorMessage(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function FormatErrorMessage (name As String) As String" />
<MemberSignature Language="F#" Value="override this.FormatErrorMessage : string -> string" Usage="customValidationAttribute.FormatErrorMessage name" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::String ^ FormatErrorMessage(System::String ^ 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>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.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.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>Formats a validation error message.</summary>
<returns>An instance of the formatted error message.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The error message is formatted at run time to include the `name` value that is passed to this method.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The current attribute is malformed.</exception>
</Docs>
</Member>
<Member MemberName="IsValid">
<MemberSignature Language="C#" Value="protected override System.ComponentModel.DataAnnotations.ValidationResult IsValid (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;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;netframework-4.8.1" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig 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.CustomValidationAttribute.IsValid(System.Object,System.ComponentModel.DataAnnotations.ValidationContext)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function IsValid (value As Object, validationContext As ValidationContext) As ValidationResult" />
<MemberSignature Language="F#" Value="override this.IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult" Usage="customValidationAttribute.IsValid (value, validationContext)" />
<MemberSignature Language="C++ CLI" Value="protected:
 override System::ComponentModel::DataAnnotations::ValidationResult ^ IsValid(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);" />
<MemberSignature Language="C#" Value="protected override System.ComponentModel.DataAnnotations.ValidationResult? IsValid (object? value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;net-9.0" />
<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>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(2)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.ComponentModel.DataAnnotations.ValidationResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
<Parameter Name="validationContext" Type="System.ComponentModel.DataAnnotations.ValidationContext">
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(1)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="value">The value to validate.</param>
<param name="validationContext">An object that provides context about the validation operation, such as the object and member being validated.</param>
<summary>Overrides the validation method. See <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid System.Object,System.ComponentModel.DataAnnotations.ValidationContext)" />.</summary>
<returns>Whatever the <see cref="P:System.ComponentModel.DataAnnotations.CustomValidationAttribute.Method" /> in <see cref="P:System.ComponentModel.DataAnnotations.CustomValidationAttribute.ValidatorType" /> returns.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">The current attribute is malformed.</exception>
</Docs>
</Member>
<Member MemberName="Method">
<MemberSignature Language="C#" Value="public string Method { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Method" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.CustomValidationAttribute.Method" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Method As String" />
<MemberSignature Language="F#" Value="member this.Method : string" Usage="System.ComponentModel.DataAnnotations.CustomValidationAttribute.Method" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ Method { System::String ^ get(); };" />
<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>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<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 the validation method.</summary>
<value>The name of the validation method.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The custom method specified by this property must be public and static, and it must return a <xref:System.ComponentModel.DataAnnotations.ValidationResult> value. It must also take at least one input parameter that specifies the object to validate. This parameter can be strongly typed. If a process passes a value of a different type, type conversion will be attempted.
The specified method should return <xref:System.ComponentModel.DataAnnotations.ValidationResult.Success> if a given object is valid. Otherwise it should return custom <xref:System.ComponentModel.DataAnnotations.ValidationResult> value with optional error message.
If the method returns `null` or if it returns an empty value for the <xref:System.ComponentModel.DataAnnotations.ValidationResult.ErrorMessage%2A> property, the default <xref:System.ComponentModel.DataAnnotations.ValidationAttribute.FormatErrorMessage%2A> method will be called to compose the error message.
The custom method can also take parameter that specify a <xref:System.ComponentModel.DataAnnotations.ValidationContext> input value. Parameter provides additional context information that the method can use to determine the context that it is used in.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TypeId">
<MemberSignature Language="C#" Value="public override object TypeId { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object TypeId" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.CustomValidationAttribute.TypeId" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property TypeId As Object" />
<MemberSignature Language="F#" Value="member this.TypeId : obj" Usage="System.ComponentModel.DataAnnotations.CustomValidationAttribute.TypeId" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::Object ^ TypeId { System::Object ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a unique identifier for this attribute.</summary>
<value>The object that identifies this attribute.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ValidatorType">
<MemberSignature Language="C#" Value="public Type ValidatorType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Type ValidatorType" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.CustomValidationAttribute.ValidatorType" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ValidatorType As Type" />
<MemberSignature Language="F#" Value="member this.ValidatorType : Type" Usage="System.ComponentModel.DataAnnotations.CustomValidationAttribute.ValidatorType" />
<MemberSignature Language="C++ CLI" Value="public:
 property Type ^ ValidatorType { Type ^ get(); };" />
<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>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-6.0;net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]</AttributeName>
<AttributeName Language="F#">[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<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 the type that performs custom validation.</summary>
<value>The type that performs custom validation.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property returns the type that is passed to the ctor <xref:System.ComponentModel.DataAnnotations.CustomValidationAttribute.%23ctor%2A> constructor overload.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>