From 0edb8ac9eef9a8ac5728bae8f54f57690aab3e85 Mon Sep 17 00:00:00 2001 From: Stuart Blackburn Date: Mon, 22 Jan 2024 02:05:59 +0000 Subject: [PATCH] task: updated source gen templates --- .../Catalog.Abstractions.csproj | 2 +- .../Catalog.Api/Catalog.Api.csproj | 6 ++--- src/Directory.Build.props | 2 +- src/Primitively.Abstractions/ByteAttribute.cs | 5 +--- src/Primitively.Abstractions/Constants.cs | 8 ------ .../DateOnlyAttribute.cs | 5 +--- src/Primitively.Abstractions/GuidAttribute.cs | 5 +--- src/Primitively.Abstractions/IntAttribute.cs | 11 +++++--- src/Primitively.Abstractions/LongAttribute.cs | 5 +--- .../SByteAttribute.cs | 5 +--- .../ShortAttribute.cs | 5 +--- .../StringAttribute.cs | 5 +--- src/Primitively.Abstractions/UIntAttribute.cs | 5 +--- .../ULongAttribute.cs | 5 +--- .../UShortAttribute.cs | 5 +--- .../EmbeddedResources/PrimitiveFactory.cs | 4 ++- .../EmbeddedResources/PrimitiveLibrary.cs | 8 +++--- .../EmbeddedResources/PrimitiveRepository.cs | 22 ++++++--------- src/Primitively/MetaData.cs | 2 -- src/Primitively/Structs.cs | 27 +++++++++---------- 20 files changed, 49 insertions(+), 93 deletions(-) delete mode 100644 src/Primitively.Abstractions/Constants.cs diff --git a/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Abstractions/Catalog.Abstractions.csproj b/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Abstractions/Catalog.Abstractions.csproj index fcb42c3..3bba127 100644 --- a/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Abstractions/Catalog.Abstractions.csproj +++ b/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Abstractions/Catalog.Abstractions.csproj @@ -8,7 +8,7 @@ - + diff --git a/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Api/Catalog.Api.csproj b/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Api/Catalog.Api.csproj index 2c8a7dd..e420749 100644 --- a/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Api/Catalog.Api.csproj +++ b/examples/02-aspnetcore-mvc-api-with-mongo-db/Catalog.Api/Catalog.Api.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 867d608..955e8a8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -25,7 +25,7 @@ $(MSBuildThisFileDirectory)..\artifacts - 1.4.15-rc.1 + 1.4.15-rc.2 diff --git a/src/Primitively.Abstractions/ByteAttribute.cs b/src/Primitively.Abstractions/ByteAttribute.cs index b81412d..3074d09 100644 --- a/src/Primitively.Abstractions/ByteAttribute.cs +++ b/src/Primitively.Abstractions/ByteAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a Unsigned 8-bit integer primitive value /// with a default range of: 0 to 255 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class ByteAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively.Abstractions/Constants.cs b/src/Primitively.Abstractions/Constants.cs deleted file mode 100644 index 8a0bf13..0000000 --- a/src/Primitively.Abstractions/Constants.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Primitively; - -public struct Constants -{ - public const string ConditionalCompilationSymbol = "PRIMITIVELY_USAGES"; - public const string PrimitiveFactory = nameof(PrimitiveFactory); - public const string PrimitiveRepository = nameof(PrimitiveRepository); -} diff --git a/src/Primitively.Abstractions/DateOnlyAttribute.cs b/src/Primitively.Abstractions/DateOnlyAttribute.cs index e4f24ac..a0f98d1 100644 --- a/src/Primitively.Abstractions/DateOnlyAttribute.cs +++ b/src/Primitively.Abstractions/DateOnlyAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a DateOnly primitive value /// with default Iso8601 format of yyyy-MM-dd /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class DateOnlyAttribute : Attribute, IPimitivelyAttribute { /// diff --git a/src/Primitively.Abstractions/GuidAttribute.cs b/src/Primitively.Abstractions/GuidAttribute.cs index bbd09e2..b07c777 100644 --- a/src/Primitively.Abstractions/GuidAttribute.cs +++ b/src/Primitively.Abstractions/GuidAttribute.cs @@ -1,12 +1,9 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a GUID primitive value /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class GuidAttribute : Attribute, IPimitivelyAttribute { public GuidAttribute() diff --git a/src/Primitively.Abstractions/IntAttribute.cs b/src/Primitively.Abstractions/IntAttribute.cs index 44f610a..9b7b032 100644 --- a/src/Primitively.Abstractions/IntAttribute.cs +++ b/src/Primitively.Abstractions/IntAttribute.cs @@ -1,19 +1,22 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a Signed 32-bit integer primitive value /// with a default range of: -2,147,483,648 to 2,147,483,647 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class IntAttribute : Attribute, IIntegerAttribute { /// public bool ImplementIValidatableObject { get; set; } + + /// public int Minimum { get; set; } = int.MinValue; + + /// public int Maximum { get; set; } = int.MaxValue; + object IIntegerAttribute.Minimum { get => Minimum; } + object IIntegerAttribute.Maximum { get => Maximum; } } diff --git a/src/Primitively.Abstractions/LongAttribute.cs b/src/Primitively.Abstractions/LongAttribute.cs index 2c13d51..0b35079 100644 --- a/src/Primitively.Abstractions/LongAttribute.cs +++ b/src/Primitively.Abstractions/LongAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a Signed 64-bit integer primitive value /// with a default range of: -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class LongAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively.Abstractions/SByteAttribute.cs b/src/Primitively.Abstractions/SByteAttribute.cs index 4a4612c..e57c90f 100644 --- a/src/Primitively.Abstractions/SByteAttribute.cs +++ b/src/Primitively.Abstractions/SByteAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a Signed 8-bit integer primitive value /// with a default range of: -128 to 127 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class SByteAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively.Abstractions/ShortAttribute.cs b/src/Primitively.Abstractions/ShortAttribute.cs index 19cc12a..641cfaf 100644 --- a/src/Primitively.Abstractions/ShortAttribute.cs +++ b/src/Primitively.Abstractions/ShortAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates a Signed 16-bit integer primitive value /// with a default range of: -32,768 to 32,767 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class ShortAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively.Abstractions/StringAttribute.cs b/src/Primitively.Abstractions/StringAttribute.cs index 7b21288..1de1268 100644 --- a/src/Primitively.Abstractions/StringAttribute.cs +++ b/src/Primitively.Abstractions/StringAttribute.cs @@ -1,6 +1,4 @@ -using System.Diagnostics; - -#nullable enable +#nullable enable namespace Primitively; @@ -8,7 +6,6 @@ namespace Primitively; /// Make a readonly record struct that encapsulates a String primitive value /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class StringAttribute : Attribute, IPimitivelyAttribute { /// diff --git a/src/Primitively.Abstractions/UIntAttribute.cs b/src/Primitively.Abstractions/UIntAttribute.cs index 7dba08e..e22ee3a 100644 --- a/src/Primitively.Abstractions/UIntAttribute.cs +++ b/src/Primitively.Abstractions/UIntAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates an Unsigned 32-bit integer primitive value /// with a default range of: 0 to 4,294,967,295 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class UIntAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively.Abstractions/ULongAttribute.cs b/src/Primitively.Abstractions/ULongAttribute.cs index 04e4bf0..37355e6 100644 --- a/src/Primitively.Abstractions/ULongAttribute.cs +++ b/src/Primitively.Abstractions/ULongAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates an Unsigned 64-bit integer primitive value /// with a default range of: 0 to 18,446,744,073,709,551,615 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class ULongAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively.Abstractions/UShortAttribute.cs b/src/Primitively.Abstractions/UShortAttribute.cs index 5559897..15e5940 100644 --- a/src/Primitively.Abstractions/UShortAttribute.cs +++ b/src/Primitively.Abstractions/UShortAttribute.cs @@ -1,13 +1,10 @@ -using System.Diagnostics; - -namespace Primitively; +namespace Primitively; /// /// Make a readonly record struct that encapsulates an Unsigned 16-bit integer primitive value /// with a default range of: 0 to 65,535 /// [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] -[Conditional(Constants.ConditionalCompilationSymbol)] public sealed class UShortAttribute : Attribute, IIntegerAttribute { /// diff --git a/src/Primitively/EmbeddedResources/PrimitiveFactory.cs b/src/Primitively/EmbeddedResources/PrimitiveFactory.cs index 022803f..8238567 100644 --- a/src/Primitively/EmbeddedResources/PrimitiveFactory.cs +++ b/src/Primitively/EmbeddedResources/PrimitiveFactory.cs @@ -1,4 +1,6 @@ -public partial class PrimitiveFactory : Primitively.IPrimitiveFactory +namespace PRIMITIVE_NAMESPACE; + +public partial class PrimitiveFactory : Primitively.IPrimitiveFactory { #nullable enable public Primitively.IPrimitive? Create(System.Type type, string? value) diff --git a/src/Primitively/EmbeddedResources/PrimitiveLibrary.cs b/src/Primitively/EmbeddedResources/PrimitiveLibrary.cs index 5225f02..4e26857 100644 --- a/src/Primitively/EmbeddedResources/PrimitiveLibrary.cs +++ b/src/Primitively/EmbeddedResources/PrimitiveLibrary.cs @@ -1,10 +1,8 @@ -using Primitively; - -namespace PRIMITIVE_NAMESPACE; +namespace PRIMITIVE_NAMESPACE; public readonly record struct PrimitiveLibrary { - public static IPrimitiveRepository Respository { get; } = new PrimitiveRepository(); - public static IPrimitiveFactory Factory { get; } = new PrimitiveFactory(); + public static Primitively.IPrimitiveRepository Respository { get; } = new PrimitiveRepository(); + public static Primitively.IPrimitiveFactory Factory { get; } = new PrimitiveFactory(); public static bool HasTypes => PRIMITIVE_LIBRARY_HAS_TYPES; } diff --git a/src/Primitively/EmbeddedResources/PrimitiveRepository.cs b/src/Primitively/EmbeddedResources/PrimitiveRepository.cs index 83a7bf0..e9e6e36 100644 --- a/src/Primitively/EmbeddedResources/PrimitiveRepository.cs +++ b/src/Primitively/EmbeddedResources/PrimitiveRepository.cs @@ -1,18 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using Primitively; +namespace PRIMITIVE_NAMESPACE; -namespace PRIMITIVE_NAMESPACE; - -public partial class PrimitiveRepository : IPrimitiveRepository +public partial class PrimitiveRepository : Primitively.IPrimitiveRepository { - private static readonly Lazy> _types = new(GetAll, LazyThreadSafetyMode.ExecutionAndPublication); + private static readonly System.Lazy> _types = new(GetAll, System.Threading.LazyThreadSafetyMode.ExecutionAndPublication); - public PrimitiveInfo GetType(Type type) => _types.Value.Single(t => t.Type.Equals(type)); + public Primitively.PrimitiveInfo GetType(System.Type type) => _types.Value.Single(t => t.Type.Equals(type)); #nullable enable - public bool TryGetType(Type type, out PrimitiveInfo? result) + public bool TryGetType(System.Type type, out Primitively.PrimitiveInfo? result) #nullable disable { result = _types.Value.SingleOrDefault(t => t.Type.Equals(type)); @@ -20,11 +14,11 @@ public bool TryGetType(Type type, out PrimitiveInfo? result) return result is not null; } - public IReadOnlyCollection GetTypes() => _types.Value.ToList(); + public System.Collections.Generic.IReadOnlyCollection GetTypes() => _types.Value.ToList(); - public IReadOnlyCollection GetTypes() where T : PrimitiveInfo => _types.Value.OfType().ToList(); + public System.Collections.Generic.IReadOnlyCollection GetTypes() where T : Primitively.PrimitiveInfo => _types.Value.OfType().ToList(); - private static IEnumerable GetAll() + private static System.Collections.Generic.IEnumerable GetAll() { PRIMITIVE_REPOSITORY_YIELD_STATEMENTS } diff --git a/src/Primitively/MetaData.cs b/src/Primitively/MetaData.cs index 4143600..3b50b19 100644 --- a/src/Primitively/MetaData.cs +++ b/src/Primitively/MetaData.cs @@ -2,8 +2,6 @@ internal readonly struct MetaData { - public const string ConditionalCompilationSymbol = "PRIMITIVELY_USAGES"; - public readonly struct DateOnly { public static readonly string Interface = typeof(IDateOnly).FullName; diff --git a/src/Primitively/Structs.cs b/src/Primitively/Structs.cs index f89092d..2a0edf7 100644 --- a/src/Primitively/Structs.cs +++ b/src/Primitively/Structs.cs @@ -159,11 +159,10 @@ private static void GenerateFactoryFile(SourceProductionContext context, List();"); + yieldStatements.Add($"{Padding}return System.Linq.Enumerable.Empty();"); } else { @@ -191,17 +190,17 @@ private static void GenerateRepositoryFile(SourceProductionContext context, List .OrderBy(rs => rs.Name) .Select(rs => rs.DataType switch { - DataType.DateOnly => $"{Padding}yield return new DateOnlyInfo(typeof({rs.NameSpace}.{rs.Name}), typeof(DateOnly), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, \"{rs.Format}\", {rs.Length});", - DataType.Guid => $"{Padding}yield return new GuidInfo(typeof({rs.NameSpace}.{rs.Name}), typeof(Guid), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {nameof(rs.Specifier)}.{rs.Specifier}, {rs.Length});", - DataType.Byte => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.Byte)}, typeof({rs.NameSpace}.{rs.Name}), typeof(byte), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.SByte => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.SByte)}, typeof({rs.NameSpace}.{rs.Name}), typeof(sbyte), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.Short => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.Short)}, typeof({rs.NameSpace}.{rs.Name}), typeof(short), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.UShort => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.UShort)}, typeof({rs.NameSpace}.{rs.Name}), typeof(ushort), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.Int => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.Int)}, typeof({rs.NameSpace}.{rs.Name}), typeof(int), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.UInt => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.UInt)}, typeof({rs.NameSpace}.{rs.Name}), typeof(uint), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.Long => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.Long)}, typeof({rs.NameSpace}.{rs.Name}), typeof(long), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.ULong => $"{Padding}yield return new IntegerInfo({nameof(DataType)}.{nameof(DataType.ULong)}, typeof({rs.NameSpace}.{rs.Name}), typeof(ulong), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", - DataType.String => $"{Padding}yield return new StringInfo(typeof({rs.NameSpace}.{rs.Name}), typeof(string), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, \"{rs.Format}\", \"{rs.Pattern}\", {rs.MinLength}, {rs.MaxLength});", + DataType.DateOnly => $"{Padding}yield return new Primitively.DateOnlyInfo(typeof({rs.NameSpace}.{rs.Name}), typeof(System.DateOnly), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, \"{rs.Format}\", {rs.Length});", + DataType.Guid => $"{Padding}yield return new Primitively.GuidInfo(typeof({rs.NameSpace}.{rs.Name}), typeof(System.Guid), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {nameof(rs.Specifier)}.{rs.Specifier}, {rs.Length});", + DataType.Byte => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.Byte)}, typeof({rs.NameSpace}.{rs.Name}), typeof(byte), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.SByte => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.SByte)}, typeof({rs.NameSpace}.{rs.Name}), typeof(sbyte), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.Short => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.Short)}, typeof({rs.NameSpace}.{rs.Name}), typeof(short), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.UShort => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.UShort)}, typeof({rs.NameSpace}.{rs.Name}), typeof(ushort), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.Int => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.Int)}, typeof({rs.NameSpace}.{rs.Name}), typeof(int), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.UInt => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.UInt)}, typeof({rs.NameSpace}.{rs.Name}), typeof(uint), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.Long => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.Long)}, typeof({rs.NameSpace}.{rs.Name}), typeof(long), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.ULong => $"{Padding}yield return new Primitively.IntegerInfo({nameof(DataType)}.{nameof(DataType.ULong)}, typeof({rs.NameSpace}.{rs.Name}), typeof(ulong), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, {rs.Minimum ?? 0}, {rs.Maximum ?? 0});", + DataType.String => $"{Padding}yield return new Primitively.StringInfo(typeof({rs.NameSpace}.{rs.Name}), typeof(string), \"{rs.Example}\", (value) => ({rs.NameSpace}.{rs.Name})value, \"{rs.Format}\", \"{rs.Pattern}\", {rs.MinLength}, {rs.MaxLength});", _ => throw new NotImplementedException() });