Skip to content

Commit 574d2cc

Browse files
Port System.ComponentModel.DataAnnotations APIs (#9197)
1 parent d1935de commit 574d2cc

File tree

5 files changed

+41
-34
lines changed

5 files changed

+41
-34
lines changed

xml/System.ComponentModel.DataAnnotations/AllowedValuesAttribute.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</Attribute>
2525
</Attributes>
2626
<Docs>
27-
<summary>To be added.</summary>
27+
<summary>Specifies a list of values that should be allowed in a property.</summary>
2828
<remarks>To be added.</remarks>
2929
</Docs>
3030
<Members>
@@ -55,8 +55,8 @@
5555
</Parameter>
5656
</Parameters>
5757
<Docs>
58-
<param name="values">To be added.</param>
59-
<summary>To be added.</summary>
58+
<param name="values">A list of values that the validated value should be equal to.</param>
59+
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.AllowedValuesAttribute" /> class.</summary>
6060
<remarks>To be added.</remarks>
6161
</Docs>
6262
</Member>
@@ -85,10 +85,11 @@
8585
<Parameter Name="value" Type="System.Object" />
8686
</Parameters>
8787
<Docs>
88-
<param name="value">To be added.</param>
89-
<summary>To be added.</summary>
90-
<returns>To be added.</returns>
91-
<remarks>To be added.</remarks>
88+
<param name="value">The object to validate.</param>
89+
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
90+
<returns>
91+
<see langword="true" /> if any of the <see cref="P:System.ComponentModel.DataAnnotations.AllowedValuesAttribute.Values" /> are equal to <paramref name="value" />, otherwise <see langword="false" /></returns>
92+
<remarks>This method can return <see langword="true" /> if the <paramref name="value" /> is <see langword="null" />, provided that <see langword="null" /> is also specified in one of the <see cref="P:System.ComponentModel.DataAnnotations.AllowedValuesAttribute.Values" />.</remarks>
9293
</Docs>
9394
</Member>
9495
<Member MemberName="Values">
@@ -113,7 +114,7 @@
113114
<ReturnType>System.Object[]</ReturnType>
114115
</ReturnValue>
115116
<Docs>
116-
<summary>To be added.</summary>
117+
<summary>Gets the list of values allowed by this attribute.</summary>
117118
<value>To be added.</value>
118119
<remarks>To be added.</remarks>
119120
</Docs>

xml/System.ComponentModel.DataAnnotations/Base64StringAttribute.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
24-
<remarks>To be added.</remarks>
23+
<summary>Specifies that a data field value is a well-formed Base64 string.</summary>
24+
<remarks>Recognition of valid Base64 is delegated to the <see cref="T:System.Convert" /> class, using the <see cref="M:System.Convert.TryFromBase64String(System.String,System.Span{System.Byte},System.Int32@)" /> method.</remarks>
2525
</Docs>
2626
<Members>
2727
<Member MemberName=".ctor">
@@ -37,7 +37,7 @@
3737
</AssemblyInfo>
3838
<Parameters />
3939
<Docs>
40-
<summary>To be added.</summary>
40+
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.Base64StringAttribute" /> class.</summary>
4141
<remarks>To be added.</remarks>
4242
</Docs>
4343
</Member>
@@ -66,9 +66,10 @@
6666
<Parameter Name="value" Type="System.Object" />
6767
</Parameters>
6868
<Docs>
69-
<param name="value">To be added.</param>
70-
<summary>To be added.</summary>
71-
<returns>To be added.</returns>
69+
<param name="value">The object to validate.</param>
70+
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
71+
<returns>
72+
<see langword="true" /> if <paramref name="value" /> is <see langword="null" /> or is a valid Base64 string, otherwise <see langword="false" /></returns>
7273
<remarks>To be added.</remarks>
7374
</Docs>
7475
</Member>

xml/System.ComponentModel.DataAnnotations/DeniedValuesAttribute.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</Attribute>
2525
</Attributes>
2626
<Docs>
27-
<summary>To be added.</summary>
27+
<summary>Specifies a list of values that should not be allowed in a property.</summary>
2828
<remarks>To be added.</remarks>
2929
</Docs>
3030
<Members>
@@ -55,8 +55,8 @@
5555
</Parameter>
5656
</Parameters>
5757
<Docs>
58-
<param name="values">To be added.</param>
59-
<summary>To be added.</summary>
58+
<param name="values">A list of values that the validated value should not be equal to.</param>
59+
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.DeniedValuesAttribute" /> class.</summary>
6060
<remarks>To be added.</remarks>
6161
</Docs>
6262
</Member>
@@ -85,10 +85,11 @@
8585
<Parameter Name="value" Type="System.Object" />
8686
</Parameters>
8787
<Docs>
88-
<param name="value">To be added.</param>
89-
<summary>To be added.</summary>
90-
<returns>To be added.</returns>
91-
<remarks>To be added.</remarks>
88+
<param name="value">The object to validate.</param>
89+
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
90+
<returns>
91+
<see langword="true" /> if none of the <see cref="P:System.ComponentModel.DataAnnotations.DeniedValuesAttribute.Values" /> are equal to <paramref name="value" />, otherwise <see langword="false" />.</returns>
92+
<remarks>This method can return <see langword="true" /> if the <paramref name="value" /> is <see langword="null" />, provided that <see langword="null" /> is not specified in any of the <see cref="P:System.ComponentModel.DataAnnotations.DeniedValuesAttribute.Values" />.</remarks>
9293
</Docs>
9394
</Member>
9495
<Member MemberName="Values">
@@ -113,7 +114,7 @@
113114
<ReturnType>System.Object[]</ReturnType>
114115
</ReturnValue>
115116
<Docs>
116-
<summary>To be added.</summary>
117+
<summary>Gets the list of values denied by this attribute.</summary>
117118
<value>To be added.</value>
118119
<remarks>To be added.</remarks>
119120
</Docs>

xml/System.ComponentModel.DataAnnotations/LengthAttribute.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
23+
<summary>Specifies the minimum and maximum length of collection/string data allowed in a property.</summary>
2424
<remarks>To be added.</remarks>
2525
</Docs>
2626
<Members>
@@ -78,9 +78,9 @@
7878
<Parameter Name="name" Type="System.String" />
7979
</Parameters>
8080
<Docs>
81-
<param name="name">To be added.</param>
82-
<summary>To be added.</summary>
83-
<returns>To be added.</returns>
81+
<param name="name">The name to include in the formatted string.</param>
82+
<summary>Applies formatting to a specified error message. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.FormatErrorMessage(System.String)" />)</summary>
83+
<returns>A localized string to describe the minimum acceptable length.</returns>
8484
<remarks>To be added.</remarks>
8585
</Docs>
8686
</Member>
@@ -109,10 +109,14 @@
109109
<Parameter Name="value" Type="System.Object" />
110110
</Parameters>
111111
<Docs>
112-
<param name="value">To be added.</param>
113-
<summary>To be added.</summary>
114-
<returns>To be added.</returns>
115-
<remarks>To be added.</remarks>
112+
<param name="value">The object to validate.</param>
113+
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
114+
<returns>
115+
<see langword="true" /> if the value is <see langword="null" /> or its length is between the specified minimum length and maximum length, otherwise <see langword="false" /></returns>
116+
<remarks>This method returns <see langword="true" /> if the <paramref name="value" /> is <see langword="null" />.
117+
It is assumed the <see cref="T:System.ComponentModel.DataAnnotations.RequiredAttribute" /> is used if the value may not be <see langword="null" />.</remarks>
118+
<exception cref="T:System.InvalidOperationException">
119+
<see cref="P:System.ComponentModel.DataAnnotations.LengthAttribute.MinimumLength" /> is less than zero or <see cref="P:System.ComponentModel.DataAnnotations.LengthAttribute.MaximumLength" /> is less than <see cref="P:System.ComponentModel.DataAnnotations.LengthAttribute.MinimumLength" />.</exception>
116120
</Docs>
117121
</Member>
118122
<Member MemberName="MaximumLength">
@@ -131,7 +135,7 @@
131135
<ReturnType>System.Int32</ReturnType>
132136
</ReturnValue>
133137
<Docs>
134-
<summary>To be added.</summary>
138+
<summary>Gets the maximum allowable length of the collection/string data.</summary>
135139
<value>To be added.</value>
136140
<remarks>To be added.</remarks>
137141
</Docs>
@@ -152,7 +156,7 @@
152156
<ReturnType>System.Int32</ReturnType>
153157
</ReturnValue>
154158
<Docs>
155-
<summary>To be added.</summary>
159+
<summary>Gets the minimum allowable length of the collection/string data.</summary>
156160
<value>To be added.</value>
157161
<remarks>To be added.</remarks>
158162
</Docs>

xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ This property has no effect on the constructors with <xref:System.Int32> or <xre
438438
<ReturnType>System.Boolean</ReturnType>
439439
</ReturnValue>
440440
<Docs>
441-
<summary>To be added.</summary>
441+
<summary>Specifies whether validation should fail for values that are equal to <see cref="P:System.ComponentModel.DataAnnotations.RangeAttribute.Maximum" />.</summary>
442442
<value>To be added.</value>
443443
<remarks>To be added.</remarks>
444444
</Docs>
@@ -510,7 +510,7 @@ This property has no effect on the constructors with <xref:System.Int32> or <xre
510510
<ReturnType>System.Boolean</ReturnType>
511511
</ReturnValue>
512512
<Docs>
513-
<summary>To be added.</summary>
513+
<summary>Specifies whether validation should fail for values that are equal to <see cref="P:System.ComponentModel.DataAnnotations.RangeAttribute.Minimum" />.</summary>
514514
<value>To be added.</value>
515515
<remarks>To be added.</remarks>
516516
</Docs>

0 commit comments

Comments
 (0)