Skip to content

Commit

Permalink
Port System.ComponentModel.DataAnnotations APIs (#9197)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriktsarpalis authored Aug 17, 2023
1 parent d1935de commit 574d2cc
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</Attribute>
</Attributes>
<Docs>
<summary>To be added.</summary>
<summary>Specifies a list of values that should be allowed in a property.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
Expand Down Expand Up @@ -55,8 +55,8 @@
</Parameter>
</Parameters>
<Docs>
<param name="values">To be added.</param>
<summary>To be added.</summary>
<param name="values">A list of values that the validated value should be equal to.</param>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.AllowedValuesAttribute" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -85,10 +85,11 @@
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="value">The object to validate.</param>
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
<returns>
<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>
<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>
</Docs>
</Member>
<Member MemberName="Values">
Expand All @@ -113,7 +114,7 @@
<ReturnType>System.Object[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Gets the list of values allowed by this attribute.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</Attribute>
</Attributes>
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
<summary>Specifies that a data field value is a well-formed Base64 string.</summary>
<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>
</Docs>
<Members>
<Member MemberName=".ctor">
Expand All @@ -37,7 +37,7 @@
</AssemblyInfo>
<Parameters />
<Docs>
<summary>To be added.</summary>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.Base64StringAttribute" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -66,9 +66,10 @@
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="value">The object to validate.</param>
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
<returns>
<see langword="true" /> if <paramref name="value" /> is <see langword="null" /> or is a valid Base64 string, otherwise <see langword="false" /></returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</Attribute>
</Attributes>
<Docs>
<summary>To be added.</summary>
<summary>Specifies a list of values that should not be allowed in a property.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
Expand Down Expand Up @@ -55,8 +55,8 @@
</Parameter>
</Parameters>
<Docs>
<param name="values">To be added.</param>
<summary>To be added.</summary>
<param name="values">A list of values that the validated value should not be equal to.</param>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DataAnnotations.DeniedValuesAttribute" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -85,10 +85,11 @@
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="value">The object to validate.</param>
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
<returns>
<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>
<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>
</Docs>
</Member>
<Member MemberName="Values">
Expand All @@ -113,7 +114,7 @@
<ReturnType>System.Object[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Gets the list of values denied by this attribute.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
Expand Down
24 changes: 14 additions & 10 deletions xml/System.ComponentModel.DataAnnotations/LengthAttribute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</Attribute>
</Attributes>
<Docs>
<summary>To be added.</summary>
<summary>Specifies the minimum and maximum length of collection/string data allowed in a property.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
Expand Down Expand Up @@ -78,9 +78,9 @@
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="name">The name to include in the formatted string.</param>
<summary>Applies formatting to a specified error message. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.FormatErrorMessage(System.String)" />)</summary>
<returns>A localized string to describe the minimum acceptable length.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -109,10 +109,14 @@
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="value">The object to validate.</param>
<summary>Determines whether a specified object is valid. (Overrides <see cref="M:System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(System.Object)" />)</summary>
<returns>
<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>
<remarks>This method returns <see langword="true" /> if the <paramref name="value" /> is <see langword="null" />.
It is assumed the <see cref="T:System.ComponentModel.DataAnnotations.RequiredAttribute" /> is used if the value may not be <see langword="null" />.</remarks>
<exception cref="T:System.InvalidOperationException">
<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>
</Docs>
</Member>
<Member MemberName="MaximumLength">
Expand All @@ -131,7 +135,7 @@
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Gets the maximum allowable length of the collection/string data.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
Expand All @@ -152,7 +156,7 @@
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Gets the minimum allowable length of the collection/string data.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
Expand Down
4 changes: 2 additions & 2 deletions xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ This property has no effect on the constructors with <xref:System.Int32> or <xre
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Specifies whether validation should fail for values that are equal to <see cref="P:System.ComponentModel.DataAnnotations.RangeAttribute.Maximum" />.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
Expand Down Expand Up @@ -510,7 +510,7 @@ This property has no effect on the constructors with <xref:System.Int32> or <xre
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Specifies whether validation should fail for values that are equal to <see cref="P:System.ComponentModel.DataAnnotations.RangeAttribute.Minimum" />.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
Expand Down

0 comments on commit 574d2cc

Please sign in to comment.