Skip to content

Commit

Permalink
Add System.ComponentModel.DataAnnotations.LengthAttribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Jun 13, 2024
1 parent b304af7 commit 1d5bb1c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Qowaiv.CodeGeneration/Types/AttributeInfo.Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,41 @@ public partial class AttributeInfo
[Pure]
public static AttributeInfo Newtonsoft_Json_Serialization_JsonProperty(string name) => new(typeof(Newtonsoft.Json.JsonPropertyAttribute), new[] { name });

[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_Length(int min, int max)
=> new(typeof(System.ComponentModel.DataAnnotations.LengthAttribute), [min, max]);

[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_MinLength(int min)
=> new(typeof(System.ComponentModel.DataAnnotations.MinLengthAttribute), new object[] { min });
=> new(typeof(System.ComponentModel.DataAnnotations.MinLengthAttribute), [min]);

[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_MaxLength(int max)
=> new(typeof(System.ComponentModel.DataAnnotations.MaxLengthAttribute), new object[] { max });
=> new(typeof(System.ComponentModel.DataAnnotations.MaxLengthAttribute), [max]);

[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_Range(double? min, double? max)
=> new(typeof(System.ComponentModel.DataAnnotations.RangeAttribute), new object[] { min ?? double.MinValue, max ?? double.MaxValue });
=> new(typeof(System.ComponentModel.DataAnnotations.RangeAttribute), [min ?? double.MinValue, max ?? double.MaxValue]);

[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_RegularExpression(string pattern)
=> new(typeof(System.ComponentModel.DataAnnotations.RegularExpressionAttribute), new[] { pattern });
=> new(typeof(System.ComponentModel.DataAnnotations.RegularExpressionAttribute), [pattern]);

[Pure]
public static AttributeInfo Qowaiv_Validation_DataAnnotations_AllowedValues(params object[] values)
=> new(typeof(Qowaiv.Validation.DataAnnotations.AllowedValuesAttribute), values);

[Pure]
public static AttributeInfo Qowaiv_Validation_DataAnnotations_MultipleOf(double factor)
=> new(typeof(Qowaiv.Validation.DataAnnotations.MultipleOfAttribute), new object[] { factor });
=> new(typeof(Qowaiv.Validation.DataAnnotations.MultipleOfAttribute), [factor]);

[Pure]
public static AttributeInfo System_Text_Json_Serialization_JsonDerivedTypeAttribute(Type type)
=> new(typeof(System.Text.Json.Serialization.JsonDerivedTypeAttribute), new object[] { type });
=> new(typeof(System.Text.Json.Serialization.JsonDerivedTypeAttribute), [type]);

[Pure]
public static AttributeInfo System_Text_Json_Serialization_JsonPropertyName(string name)
=> new(typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), new[] { name });
=> new(typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), [name]);

[Pure]
public static AttributeInfo System_Runtime_Serialization_EnumMember(string? value)
Expand Down

0 comments on commit 1d5bb1c

Please sign in to comment.