Skip to content

Commit

Permalink
Beter namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Oct 23, 2024
1 parent e9d78a1 commit 952141d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Qowaiv.CodeGeneration.Syntax;

namespace Syntax.Attribute_decoration_specs;

public class Supports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Qowaiv.CodeGeneration.Syntax;
using System.Reflection;

namespace Qowaiv.CodeGeneration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,84 @@
namespace Qowaiv.CodeGeneration;
namespace Qowaiv.CodeGeneration.Syntax;

public partial class AttributeInfo
{
public static readonly AttributeInfo Newtonsoft_Json_Serialization_JsonConstructor = new(typeof(Newtonsoft.Json.JsonConstructorAttribute));
/// <summary><see cref="Newtonsoft.Json.JsonConstructorAttribute"/>.</summary>
public static readonly AttributeInfo Newtonsoft_Json_JsonConstructor = new(typeof(Newtonsoft.Json.JsonConstructorAttribute));

/// <summary><see cref="Qowaiv.Validation.DataAnnotations.AnyAttribute"/>.</summary>
public static readonly AttributeInfo Qowaiv_Validation_DataAnnotations_Any = new(typeof(Qowaiv.Validation.DataAnnotations.AnyAttribute));

/// <summary><see cref="Qowaiv.Validation.DataAnnotations.IsFiniteAttribute"/>.</summary>
public static readonly AttributeInfo Qowaiv_Validation_DataAnnotations_IsFinate = new(typeof(Qowaiv.Validation.DataAnnotations.IsFiniteAttribute));

/// <summary><see cref="Qowaiv.Validation.DataAnnotations.MandatoryAttribute"/>.</summary>
public static readonly AttributeInfo Qowaiv_Validation_DataAnnotations_Mandatory = new(typeof(Qowaiv.Validation.DataAnnotations.MandatoryAttribute));

/// <summary><see cref="Qowaiv.Validation.DataAnnotations.OptionalAttribute"/>.</summary>
public static readonly AttributeInfo Qowaiv_Validation_DataAnnotations_Optional = new(typeof(Qowaiv.Validation.DataAnnotations.OptionalAttribute));

/// <summary><see cref="System.ComponentModel.DataAnnotations.KeyAttribute"/>.</summary>
public static readonly AttributeInfo System_ComponentModel_DataAnnotations_Key = new(typeof(System.ComponentModel.DataAnnotations.KeyAttribute));

/// <summary><see cref="System.ComponentModel.DataAnnotations.RequiredAttribute"/>.</summary>
public static readonly AttributeInfo System_ComponentModel_DataAnnotations_Required = new(typeof(System.ComponentModel.DataAnnotations.RequiredAttribute));

/// <summary><see cref="System.FlagsAttribute"/>.</summary>
public static readonly AttributeInfo System_Flags = new(typeof(System.FlagsAttribute));

/// <summary><see cref="System.Text.Json.Serialization.JsonConstructorAttribute"/>.</summary>
public static readonly AttributeInfo System_Text_Json_Serialization_JsonConstructor = new(typeof(System.Text.Json.Serialization.JsonConstructorAttribute));

/// <summary><see cref="System.Text.Json.Serialization.JsonConstructorAttribute"/>.</summary>
[Pure]
public static AttributeInfo Newtonsoft_Json_Serialization_JsonProperty(string name) => new(typeof(Newtonsoft.Json.JsonPropertyAttribute), new[] { name });
public static AttributeInfo Newtonsoft_Json_Serialization_JsonProperty(string name) => new(typeof(Newtonsoft.Json.JsonPropertyAttribute), [name]);

/// <summary><see cref="System.ComponentModel.DataAnnotations.LengthAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_Length(int min, int max)
=> new(typeof(System.ComponentModel.DataAnnotations.LengthAttribute), [min, max]);

/// <summary><see cref="System.ComponentModel.DataAnnotations.MinLengthAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_MinLength(int min)
=> new(typeof(System.ComponentModel.DataAnnotations.MinLengthAttribute), [min]);

/// <summary><see cref="System.ComponentModel.DataAnnotations.MaxLengthAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_MaxLength(int max)
=> new(typeof(System.ComponentModel.DataAnnotations.MaxLengthAttribute), [max]);

/// <summary><see cref="System.ComponentModel.DataAnnotations.RangeAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_Range(double? min, double? max)
=> new(typeof(System.ComponentModel.DataAnnotations.RangeAttribute), [min ?? double.MinValue, max ?? double.MaxValue]);

/// <summary><see cref="System.ComponentModel.DataAnnotations.RegularExpressionAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_ComponentModel_DataAnnotations_RegularExpression(string pattern)
=> new(typeof(System.ComponentModel.DataAnnotations.RegularExpressionAttribute), [pattern]);

/// <summary><see cref="System.ComponentModel.DataAnnotations.AllowedValuesAttribute"/>.</summary>
[Pure]
public static AttributeInfo Qowaiv_Validation_DataAnnotations_AllowedValues(params object[] values)
=> new(typeof(Qowaiv.Validation.DataAnnotations.AllowedValuesAttribute), values);

/// <summary><see cref="Qowaiv.Validation.DataAnnotations.MultipleOfAttribute"/>.</summary>
[Pure]
public static AttributeInfo Qowaiv_Validation_DataAnnotations_MultipleOf(double factor)
=> new(typeof(Qowaiv.Validation.DataAnnotations.MultipleOfAttribute), [factor]);

/// <summary><see cref="System.Text.Json.Serialization.JsonDerivedTypeAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_Text_Json_Serialization_JsonDerivedTypeAttribute(Type type)
=> new(typeof(System.Text.Json.Serialization.JsonDerivedTypeAttribute), [type]);

/// <summary><see cref="System.Text.Json.Serialization.JsonPropertyNameAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_Text_Json_Serialization_JsonPropertyName(string name)
=> new(typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), [name]);

/// <summary><see cref="System.Runtime.Serialization.EnumMemberAttribute"/>.</summary>
[Pure]
public static AttributeInfo System_Runtime_Serialization_EnumMember(string? value)
=> new(typeof(System.Runtime.Serialization.EnumMemberAttribute), null, KeyValuePair.Create("Value", (object?)value));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Qowaiv.CodeGeneration;
namespace Qowaiv.CodeGeneration.Syntax;

/// <summary>Represents an attribute decoration.</summary>
public sealed partial class AttributeInfo : Code
Expand Down

0 comments on commit 952141d

Please sign in to comment.