From 014d8ac6fb6064ad26988640c2536438fe02f102 Mon Sep 17 00:00:00 2001 From: Andre Sharpe Date: Mon, 17 Jul 2023 17:42:07 +0200 Subject: [PATCH 1/4] Refactored Nox.Types (dotnet7) and created new Nox.Types.Abstractions. --- src/Nox.Generator.sln | 7 ++ .../Application/DtoGenerator/DtoGenerator.cs | 1 + .../ApplicationEventGenerator.cs | 1 + src/Nox.Generator/Nox.Generator.csproj | 5 +- .../ApiGenerator.OData/ODataModelGenerator.cs | 9 ++- src/Nox.Lib/Nox.Lib.csproj | 10 ++- .../Models/Application/Application.cs | 2 +- .../Application/DTO/DataTransferObject.cs | 3 +- .../Application/Events/ApplicationEvent.cs | 3 +- .../Application/Integrations/Integration.cs | 2 +- .../Schedule/IntegrationSchedule.cs | 2 +- .../IntegrationScheduleRetryPolicy.cs | 2 +- .../Integrations/Source/IntegrationSource.cs | 2 +- .../IntegrationSourceDatabaseOptions.cs | 2 +- .../IntegrationSourceDatabaseWatermark.cs | 2 +- .../Source/IntegrationSourceFileOptions.cs | 2 +- .../IntegrationSourceMessageQueueOptions.cs | 2 +- .../Source/IntegrationSourceWebApiOptions.cs | 2 +- .../Integrations/Target/IntegrationTarget.cs | 2 +- .../IntegrationTargetDatabaseOptions.cs | 2 +- .../Target/IntegrationTargetFileOptions.cs | 2 +- .../IntegrationTargetMessageQueueOptions.cs | 2 +- .../Transform/IntegrationLookup.cs | 2 +- .../Transform/IntegrationMapping.cs | 2 +- .../Transform/IntegrationMatch.cs | 2 +- .../Transform/IntegrationTransform.cs | 2 +- src/Nox.Solution/Models/Domain/Domain.cs | 2 +- .../Domain/Entities/Commands/DomainCommand.cs | 3 +- .../Models/Domain/Entities/Entity.cs | 3 +- .../Domain/Entities/Events/DomainEvent.cs | 3 +- .../Entities/Persistence/EntityPersistence.cs | 2 +- .../Domain/Entities/Queries/DomainQuery.cs | 2 +- .../RequestInput/DomainQueryRequestInput.cs | 3 +- .../DomainQueryResponseOutput.cs | 4 +- .../Relationships/EntityRelationship.cs | 2 +- .../UserInterface/EntityUserInterface.cs | 2 +- .../Models/Environment/Environment.cs | 2 +- .../Models/Infrastructure/Base/ServerBase.cs | 2 +- .../DataConnection/DataConnection.cs | 2 +- .../Dependencies/Dependencies.cs | 2 +- .../Dependencies/Monitoring/Monitoring.cs | 2 +- .../Notifications/Email/EmailServer.cs | 2 +- .../InstantMessaging/ImServer.cs | 2 +- .../Notifications/Notifications.cs | 2 +- .../Notifications/Sms/SmsServer.cs | 2 +- .../Dependencies/Translation/Translations.cs | 2 +- .../Infrastructure/Endpoints/Api/ApiServer.cs | 2 +- .../Infrastructure/Endpoints/Bff/BffServer.cs | 2 +- .../Infrastructure/Endpoints/Endpoints.cs | 2 +- .../Models/Infrastructure/Infrastructure.cs | 2 +- .../Infrastructure/Messaging/Messaging.cs | 2 +- .../Messaging/Server/MessagingServer.cs | 2 +- .../Persistence/Cache/CacheServer.cs | 2 +- .../Persistence/Database/DatabaseServer.cs | 2 +- .../EventStore/EventSourceServer.cs | 2 +- .../Infrastructure/Persistence/Persistence.cs | 2 +- .../Persistence/Search/SearchServer.cs | 2 +- .../Security/Secrets/Secrets.cs | 2 +- .../Security/Secrets/Server/SecretsServer.cs | 2 +- .../Secrets/ValidFor/SecretsValidFor.cs | 2 +- .../Infrastructure/Security/Security.cs | 2 +- src/Nox.Solution/Models/Solution.cs | 2 +- src/Nox.Solution/Models/Team/TeamMember.cs | 2 +- .../Types/TypeOptions/ArrayTypeOptions.cs | 12 --- .../Types/TypeOptions/ObjectTypeOptions.cs | 11 --- .../Folders/VersionControlFolders.cs | 2 +- .../Models/VersionControl/VersionControl.cs | 2 +- src/Nox.Solution/Nox.Solution.csproj | 2 +- .../Schema/Generator/SchemaProperty.cs | 1 + src/Nox.Solution/Schema/NoxSchemaValidator.cs | 5 -- .../Base/CollectionTypeOptionsValidator.cs | 1 + .../Base/ObjectTypeOptionsValidator.cs | 1 + .../Validation/Base/SimpleTypeValidator.cs | 1 + .../AdditionalPropertiesAttribute.cs | 2 +- .../Attributes/CompoundTypeAttribute.cs | 0 .../Attributes/DescriptionAttribute.cs | 2 +- .../Attributes/GenerateJsonSchema.cs | 2 +- .../Attributes/IfEqualsAttribute.cs | 2 +- .../Attributes/IgnoreAttribute.cs | 2 +- .../Attributes/PatternAttribute.cs | 2 +- .../Attributes/RequiredAttribute.cs | 2 +- .../Attributes/TitleAttribute.cs | 2 +- .../Enums/CurrencyCode.cs | 0 .../Enums/NoxType.cs | 0 .../Enums/TextTypeCasing.cs | 0 .../Enums/Ui/IconPosition.cs | 2 - .../Enums/Ui/Widget.cs | 4 +- .../Interfaces/INoxType.cs | 0 .../Interfaces/INoxTypeOptions.cs | 0 .../Nox.Types.Abstractions.csproj | 16 ++++ .../NoxComplexTypeDefinition.cs | 7 +- .../NoxSimpleTypeDefinition.cs | 7 +- .../TypeUserInterface/TypeUserInterface.cs | 6 +- .../TypeOptions/ArrayTypeOptions.cs | 11 +++ .../TypeOptions}/DateTypeOptions.cs | 0 .../TypeOptions}/EntityTypeOptions.cs | 0 .../TypeOptions}/MoneyTypeOptions.cs | 0 .../TypeOptions}/NumberTypeOptions.cs | 0 .../TypeOptions/ObjectTypeOptions.cs | 10 +++ .../TypeOptions}/PercentageTypeOptions.cs | 0 .../TypeOptions}/TextTypeOptions.cs | 0 .../TypeOptions}/TranslatedTextTypeOptions.cs | 0 .../TypeOptions}/YearTypeOptions.cs | 0 src/Nox.Types/Common/MeasurementUnit.cs | 6 +- src/Nox.Types/Nox.Types.csproj | 80 +++++++++++-------- src/Nox.Types/Types/Json/Json.cs | 2 +- src/Nox.Types/ValueObjectBase/ValueObject.cs | 2 +- .../ODataModel.g.cs | 47 +++++------ .../CodeAnalysisSolutionFixture.cs | 2 + .../ProjectsDependenciesTests.cs | 16 ++-- 110 files changed, 235 insertions(+), 192 deletions(-) delete mode 100644 src/Nox.Solution/Models/Types/TypeOptions/ArrayTypeOptions.cs delete mode 100644 src/Nox.Solution/Models/Types/TypeOptions/ObjectTypeOptions.cs rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/AdditionalPropertiesAttribute.cs (93%) rename src/{Nox.Types => Nox.Types.Abstractions}/Attributes/CompoundTypeAttribute.cs (100%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/DescriptionAttribute.cs (93%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/GenerateJsonSchema.cs (89%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/IfEqualsAttribute.cs (92%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/IgnoreAttribute.cs (86%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/PatternAttribute.cs (92%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/RequiredAttribute.cs (86%) rename src/{Nox.Solution/Schema => Nox.Types.Abstractions}/Attributes/TitleAttribute.cs (92%) rename src/{Nox.Types => Nox.Types.Abstractions}/Enums/CurrencyCode.cs (100%) rename src/{Nox.Types => Nox.Types.Abstractions}/Enums/NoxType.cs (100%) rename src/{Nox.Types => Nox.Types.Abstractions}/Enums/TextTypeCasing.cs (100%) rename src/{Nox.Solution => Nox.Types.Abstractions}/Enums/Ui/IconPosition.cs (72%) rename src/{Nox.Solution => Nox.Types.Abstractions}/Enums/Ui/Widget.cs (90%) rename src/{Nox.Types => Nox.Types.Abstractions}/Interfaces/INoxType.cs (100%) rename src/{Nox.Types => Nox.Types.Abstractions}/Interfaces/INoxTypeOptions.cs (100%) create mode 100644 src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj rename src/{Nox.Solution/Models/Types => Nox.Types.Abstractions}/TypeDefinitions/NoxComplexTypeDefinition.cs (85%) rename src/{Nox.Solution/Models/Types => Nox.Types.Abstractions}/TypeDefinitions/NoxSimpleTypeDefinition.cs (95%) rename src/{Nox.Solution/Models/Types => Nox.Types.Abstractions/TypeDefinitions}/TypeUserInterface/TypeUserInterface.cs (97%) create mode 100644 src/Nox.Types.Abstractions/TypeOptions/ArrayTypeOptions.cs rename src/{Nox.Types/Types/Date => Nox.Types.Abstractions/TypeOptions}/DateTypeOptions.cs (100%) rename src/{Nox.Types/Types/Entity => Nox.Types.Abstractions/TypeOptions}/EntityTypeOptions.cs (100%) rename src/{Nox.Types/Types/Money => Nox.Types.Abstractions/TypeOptions}/MoneyTypeOptions.cs (100%) rename src/{Nox.Types/Types/Number => Nox.Types.Abstractions/TypeOptions}/NumberTypeOptions.cs (100%) create mode 100644 src/Nox.Types.Abstractions/TypeOptions/ObjectTypeOptions.cs rename src/{Nox.Types/Types/Percentage => Nox.Types.Abstractions/TypeOptions}/PercentageTypeOptions.cs (100%) rename src/{Nox.Types/Types/Text => Nox.Types.Abstractions/TypeOptions}/TextTypeOptions.cs (100%) rename src/{Nox.Types/Types/TranslatedText => Nox.Types.Abstractions/TypeOptions}/TranslatedTextTypeOptions.cs (100%) rename src/{Nox.Types/Types/Year => Nox.Types.Abstractions/TypeOptions}/YearTypeOptions.cs (100%) diff --git a/src/Nox.Generator.sln b/src/Nox.Generator.sln index 2b3443ffa1..6c018d48eb 100644 --- a/src/Nox.Generator.sln +++ b/src/Nox.Generator.sln @@ -86,6 +86,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nox.Secrets.Azure", "Nox.Se EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nox.Secrets.Hashicorp", "Nox.Secrets.Hashicorp\Nox.Secrets.Hashicorp.csproj", "{0B3974A4-121C-486B-964F-9037DAD3C5E8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nox.Types.Abstractions", "Nox.Types.Abstractions\Nox.Types.Abstractions.csproj", "{15E06324-A80A-4CC5-A1DA-524A7FE847C4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -192,6 +194,10 @@ Global {0B3974A4-121C-486B-964F-9037DAD3C5E8}.Debug|Any CPU.Build.0 = Debug|Any CPU {0B3974A4-121C-486B-964F-9037DAD3C5E8}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B3974A4-121C-486B-964F-9037DAD3C5E8}.Release|Any CPU.Build.0 = Release|Any CPU + {15E06324-A80A-4CC5-A1DA-524A7FE847C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15E06324-A80A-4CC5-A1DA-524A7FE847C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15E06324-A80A-4CC5-A1DA-524A7FE847C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15E06324-A80A-4CC5-A1DA-524A7FE847C4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -221,6 +227,7 @@ Global {9C5DF8EC-0F0C-4FF0-86CC-3BE5181E6292} = {2B151195-53F6-45CD-84D5-F1E18CDFF1B0} {D017DD5E-2DE1-462A-A891-CAB16C8BF940} = {2B151195-53F6-45CD-84D5-F1E18CDFF1B0} {0B3974A4-121C-486B-964F-9037DAD3C5E8} = {2B151195-53F6-45CD-84D5-F1E18CDFF1B0} + {15E06324-A80A-4CC5-A1DA-524A7FE847C4} = {110C16ED-A11D-4B5A-ABB2-0E0F4692C77A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0E72B357-9E1E-43B5-9868-8D2B74CB2AF0} diff --git a/src/Nox.Generator/Application/DtoGenerator/DtoGenerator.cs b/src/Nox.Generator/Application/DtoGenerator/DtoGenerator.cs index a99c36c65f..45887b1275 100644 --- a/src/Nox.Generator/Application/DtoGenerator/DtoGenerator.cs +++ b/src/Nox.Generator/Application/DtoGenerator/DtoGenerator.cs @@ -1,5 +1,6 @@ using Microsoft.CodeAnalysis; using Nox.Solution; +using Nox.Types; using System.Collections.Generic; using System.Linq; using System.Reflection; diff --git a/src/Nox.Generator/Application/EventGenerator/ApplicationEventGenerator.cs b/src/Nox.Generator/Application/EventGenerator/ApplicationEventGenerator.cs index c502ec5b9e..e14d4535e1 100644 --- a/src/Nox.Generator/Application/EventGenerator/ApplicationEventGenerator.cs +++ b/src/Nox.Generator/Application/EventGenerator/ApplicationEventGenerator.cs @@ -2,6 +2,7 @@ using Microsoft.CodeAnalysis; using Nox.Generator.Common; using Nox.Solution; +using Nox.Types; namespace Nox.Generator.Application.EventGenerator; diff --git a/src/Nox.Generator/Nox.Generator.csproj b/src/Nox.Generator/Nox.Generator.csproj index 93475ce427..c8cf393a72 100644 --- a/src/Nox.Generator/Nox.Generator.csproj +++ b/src/Nox.Generator/Nox.Generator.csproj @@ -45,6 +45,8 @@ + + @@ -64,8 +66,9 @@ + - + diff --git a/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs b/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs index 9fd9dddde4..c3fb8b2ef0 100644 --- a/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs +++ b/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs @@ -119,15 +119,17 @@ private static Tuple[] GetType(NoxType type) // TODO: add other types return type switch { - NoxType.Text => GetSimpleTypeDefinition(new Text()), - NoxType.Number => GetSimpleTypeDefinition(new Number()), + //NoxType.Text => GetSimpleTypeDefinition(new Text()), + //NoxType.Number => GetSimpleTypeDefinition(new Number()), - NoxType.Money => GetMoneyDefinition(), + //NoxType.Money => GetMoneyDefinition(), _ => new[] { new Tuple(string.Empty, "string") }, }; } + /* + private static Tuple[] GetSimpleTypeDefinition(ValueObject instance) where TValueObject : ValueObject, new() { return new[] { new Tuple(string.Empty, instance.GetUnderlyingType().ToString()) }; @@ -141,4 +143,5 @@ private static Tuple[] GetMoneyDefinition() new Tuple(nameof(money.CurrencyCode), money.CurrencyCode.GetType().ToString()) }; } + */ } \ No newline at end of file diff --git a/src/Nox.Lib/Nox.Lib.csproj b/src/Nox.Lib/Nox.Lib.csproj index 45df55745e..d018fa9f99 100644 --- a/src/Nox.Lib/Nox.Lib.csproj +++ b/src/Nox.Lib/Nox.Lib.csproj @@ -68,7 +68,7 @@ true analyzers\dotnet\cs - + true analyzers\dotnet\cs @@ -76,11 +76,15 @@ true analyzers\dotnet\cs - + + true + analyzers\dotnet\cs + + true analyzers\dotnet\cs - + true lib\$(TargetFramework) diff --git a/src/Nox.Solution/Models/Application/Application.cs b/src/Nox.Solution/Models/Application/Application.cs index 5d5034fa76..7946ad55e8 100644 --- a/src/Nox.Solution/Models/Application/Application.cs +++ b/src/Nox.Solution/Models/Application/Application.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System.Collections.Generic; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/DTO/DataTransferObject.cs b/src/Nox.Solution/Models/Application/DTO/DataTransferObject.cs index ee0f528a2f..ed1428d0c5 100644 --- a/src/Nox.Solution/Models/Application/DTO/DataTransferObject.cs +++ b/src/Nox.Solution/Models/Application/DTO/DataTransferObject.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; -using Nox.Solution.Schema; +using Nox.Types.Schema; +using Nox.Types; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Events/ApplicationEvent.cs b/src/Nox.Solution/Models/Application/Events/ApplicationEvent.cs index 727e4a5a93..391676f9eb 100644 --- a/src/Nox.Solution/Models/Application/Events/ApplicationEvent.cs +++ b/src/Nox.Solution/Models/Application/Events/ApplicationEvent.cs @@ -1,4 +1,5 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; +using Nox.Types; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Integration.cs b/src/Nox.Solution/Models/Application/Integrations/Integration.cs index 3c46ce85d1..f785fc6635 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Integration.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Integration.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationSchedule.cs b/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationSchedule.cs index bbe090ef58..9be48fde13 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationSchedule.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationSchedule.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationScheduleRetryPolicy.cs b/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationScheduleRetryPolicy.cs index 0e199747c2..e7acaeb50c 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationScheduleRetryPolicy.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Schedule/IntegrationScheduleRetryPolicy.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSource.cs b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSource.cs index 08845ba35b..e4d58ab3d7 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSource.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSource.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseOptions.cs index 1105c6d94e..6f5690283d 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseWatermark.cs b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseWatermark.cs index f436933171..a137f3cabb 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseWatermark.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceDatabaseWatermark.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceFileOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceFileOptions.cs index 71c6b87657..2ab1d1c1c9 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceFileOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceFileOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceMessageQueueOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceMessageQueueOptions.cs index 4f0e3e744d..39441e15cb 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceMessageQueueOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceMessageQueueOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceWebApiOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceWebApiOptions.cs index 8fe479918d..8dc3172d6d 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceWebApiOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Source/IntegrationSourceWebApiOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTarget.cs b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTarget.cs index d6a5b59c92..b752aa01a0 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTarget.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTarget.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetDatabaseOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetDatabaseOptions.cs index 548b01c88a..e922f23036 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetDatabaseOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetDatabaseOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetFileOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetFileOptions.cs index 3ab66adbd1..a122849cd8 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetFileOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetFileOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetMessageQueueOptions.cs b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetMessageQueueOptions.cs index 6365911de3..507b570010 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetMessageQueueOptions.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Target/IntegrationTargetMessageQueueOptions.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationLookup.cs b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationLookup.cs index cffa7860b8..8370d53e63 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationLookup.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationLookup.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMapping.cs b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMapping.cs index d28f2db3d4..e99ecfd900 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMapping.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMapping.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMatch.cs b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMatch.cs index 480cf3939f..a5e5768ae1 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMatch.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationMatch.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationTransform.cs b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationTransform.cs index 510a30c908..0221740412 100644 --- a/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationTransform.cs +++ b/src/Nox.Solution/Models/Application/Integrations/Transform/IntegrationTransform.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Domain.cs b/src/Nox.Solution/Models/Domain/Domain.cs index 9e44fb0439..7b542990e0 100644 --- a/src/Nox.Solution/Models/Domain/Domain.cs +++ b/src/Nox.Solution/Models/Domain/Domain.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System.Collections.Generic; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/Commands/DomainCommand.cs b/src/Nox.Solution/Models/Domain/Entities/Commands/DomainCommand.cs index f6e5dd985a..d8c1f8c24c 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Commands/DomainCommand.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Commands/DomainCommand.cs @@ -1,4 +1,5 @@ -using Nox.Solution.Schema; +using Nox.Types; +using Nox.Types.Schema; using System.Collections.Generic; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/Entity.cs b/src/Nox.Solution/Models/Domain/Entities/Entity.cs index 8e22380b92..bfdc217ea4 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Entity.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Entity.cs @@ -1,4 +1,5 @@ -using Nox.Solution.Schema; +using Nox.Types; +using Nox.Types.Schema; using System.Collections.Generic; using Humanizer; using Nox.Solution.Events; diff --git a/src/Nox.Solution/Models/Domain/Entities/Events/DomainEvent.cs b/src/Nox.Solution/Models/Domain/Entities/Events/DomainEvent.cs index a6aa12d9d3..c3064daeec 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Events/DomainEvent.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Events/DomainEvent.cs @@ -1,4 +1,5 @@ -using Nox.Solution.Schema; +using Nox.Types; +using Nox.Types.Schema; namespace Nox.Solution.Events; diff --git a/src/Nox.Solution/Models/Domain/Entities/Persistence/EntityPersistence.cs b/src/Nox.Solution/Models/Domain/Entities/Persistence/EntityPersistence.cs index 019412f1bd..69a7429496 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Persistence/EntityPersistence.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Persistence/EntityPersistence.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/Queries/DomainQuery.cs b/src/Nox.Solution/Models/Domain/Entities/Queries/DomainQuery.cs index 6c9370935b..f12574489b 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Queries/DomainQuery.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Queries/DomainQuery.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System.Collections.Generic; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/Queries/RequestInput/DomainQueryRequestInput.cs b/src/Nox.Solution/Models/Domain/Entities/Queries/RequestInput/DomainQueryRequestInput.cs index c679e5795e..81556ec9eb 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Queries/RequestInput/DomainQueryRequestInput.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Queries/RequestInput/DomainQueryRequestInput.cs @@ -1,4 +1,5 @@ -using Nox.Solution.Schema; +using Nox.Types; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/Queries/ResponseOutput/DomainQueryResponseOutput.cs b/src/Nox.Solution/Models/Domain/Entities/Queries/ResponseOutput/DomainQueryResponseOutput.cs index 87da24ed5e..de29f54f60 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Queries/ResponseOutput/DomainQueryResponseOutput.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Queries/ResponseOutput/DomainQueryResponseOutput.cs @@ -1,6 +1,6 @@  - -using Nox.Solution.Schema; +using Nox.Types; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/Relationships/EntityRelationship.cs b/src/Nox.Solution/Models/Domain/Entities/Relationships/EntityRelationship.cs index 49a05a9ab5..b5b24d5a85 100644 --- a/src/Nox.Solution/Models/Domain/Entities/Relationships/EntityRelationship.cs +++ b/src/Nox.Solution/Models/Domain/Entities/Relationships/EntityRelationship.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using YamlDotNet.Serialization; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Domain/Entities/UserInterface/EntityUserInterface.cs b/src/Nox.Solution/Models/Domain/Entities/UserInterface/EntityUserInterface.cs index 1796128f1c..360eea7e80 100644 --- a/src/Nox.Solution/Models/Domain/Entities/UserInterface/EntityUserInterface.cs +++ b/src/Nox.Solution/Models/Domain/Entities/UserInterface/EntityUserInterface.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; [GenerateJsonSchema] diff --git a/src/Nox.Solution/Models/Environment/Environment.cs b/src/Nox.Solution/Models/Environment/Environment.cs index 6b86918709..e8fec28a84 100644 --- a/src/Nox.Solution/Models/Environment/Environment.cs +++ b/src/Nox.Solution/Models/Environment/Environment.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System.Collections.Generic; namespace Nox.Solution diff --git a/src/Nox.Solution/Models/Infrastructure/Base/ServerBase.cs b/src/Nox.Solution/Models/Infrastructure/Base/ServerBase.cs index c4dedd6a20..542097c787 100644 --- a/src/Nox.Solution/Models/Infrastructure/Base/ServerBase.cs +++ b/src/Nox.Solution/Models/Infrastructure/Base/ServerBase.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System.Collections.Generic; using static Humanizer.In; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/DataConnection/DataConnection.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/DataConnection/DataConnection.cs index 7803bb75ea..c1e0d70c0f 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/DataConnection/DataConnection.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/DataConnection/DataConnection.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Dependencies.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Dependencies.cs index c0e8b3a76e..27fbdb0f84 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Dependencies.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Dependencies.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Monitoring/Monitoring.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Monitoring/Monitoring.cs index 64579187f0..809ec54300 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Monitoring/Monitoring.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Monitoring/Monitoring.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Email/EmailServer.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Email/EmailServer.cs index 6b68b71263..6b949627bd 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Email/EmailServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Email/EmailServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/InstantMessaging/ImServer.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/InstantMessaging/ImServer.cs index b3a14d1fef..296d6693b2 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/InstantMessaging/ImServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/InstantMessaging/ImServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Notifications.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Notifications.cs index 787a88f91b..3c2f2c52be 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Notifications.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Notifications.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Sms/SmsServer.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Sms/SmsServer.cs index 603a7e447b..e2a1fe07be 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Sms/SmsServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Notifications/Sms/SmsServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Dependencies/Translation/Translations.cs b/src/Nox.Solution/Models/Infrastructure/Dependencies/Translation/Translations.cs index 694e01e84a..8b86bc68e6 100644 --- a/src/Nox.Solution/Models/Infrastructure/Dependencies/Translation/Translations.cs +++ b/src/Nox.Solution/Models/Infrastructure/Dependencies/Translation/Translations.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Endpoints/Api/ApiServer.cs b/src/Nox.Solution/Models/Infrastructure/Endpoints/Api/ApiServer.cs index 3e6867f689..02bdab9c43 100644 --- a/src/Nox.Solution/Models/Infrastructure/Endpoints/Api/ApiServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Endpoints/Api/ApiServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Endpoints/Bff/BffServer.cs b/src/Nox.Solution/Models/Infrastructure/Endpoints/Bff/BffServer.cs index b07e96ea92..39fe5e2bcb 100644 --- a/src/Nox.Solution/Models/Infrastructure/Endpoints/Bff/BffServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Endpoints/Bff/BffServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Endpoints/Endpoints.cs b/src/Nox.Solution/Models/Infrastructure/Endpoints/Endpoints.cs index 7e7b11bce3..ec3f585c0b 100644 --- a/src/Nox.Solution/Models/Infrastructure/Endpoints/Endpoints.cs +++ b/src/Nox.Solution/Models/Infrastructure/Endpoints/Endpoints.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Infrastructure/Infrastructure.cs b/src/Nox.Solution/Models/Infrastructure/Infrastructure.cs index 0a59ff9dc7..2b79b08b3d 100644 --- a/src/Nox.Solution/Models/Infrastructure/Infrastructure.cs +++ b/src/Nox.Solution/Models/Infrastructure/Infrastructure.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Messaging/Messaging.cs b/src/Nox.Solution/Models/Infrastructure/Messaging/Messaging.cs index 904b0ad0e2..34b4d377c4 100644 --- a/src/Nox.Solution/Models/Infrastructure/Messaging/Messaging.cs +++ b/src/Nox.Solution/Models/Infrastructure/Messaging/Messaging.cs @@ -1,5 +1,5 @@  -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Infrastructure/Messaging/Server/MessagingServer.cs b/src/Nox.Solution/Models/Infrastructure/Messaging/Server/MessagingServer.cs index 1c2a277066..83129cf6ce 100644 --- a/src/Nox.Solution/Models/Infrastructure/Messaging/Server/MessagingServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Messaging/Server/MessagingServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using Nox.Solution.Builders; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Persistence/Cache/CacheServer.cs b/src/Nox.Solution/Models/Infrastructure/Persistence/Cache/CacheServer.cs index 98032f3074..9a3d0bd31d 100644 --- a/src/Nox.Solution/Models/Infrastructure/Persistence/Cache/CacheServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Persistence/Cache/CacheServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Persistence/Database/DatabaseServer.cs b/src/Nox.Solution/Models/Infrastructure/Persistence/Database/DatabaseServer.cs index 2742d817af..4677f4efe1 100644 --- a/src/Nox.Solution/Models/Infrastructure/Persistence/Database/DatabaseServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Persistence/Database/DatabaseServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Persistence/EventStore/EventSourceServer.cs b/src/Nox.Solution/Models/Infrastructure/Persistence/EventStore/EventSourceServer.cs index d541db2b43..b86f9976e3 100644 --- a/src/Nox.Solution/Models/Infrastructure/Persistence/EventStore/EventSourceServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Persistence/EventStore/EventSourceServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Persistence/Persistence.cs b/src/Nox.Solution/Models/Infrastructure/Persistence/Persistence.cs index 18c3614ee7..b0cba7e417 100644 --- a/src/Nox.Solution/Models/Infrastructure/Persistence/Persistence.cs +++ b/src/Nox.Solution/Models/Infrastructure/Persistence/Persistence.cs @@ -1,5 +1,5 @@  -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Persistence/Search/SearchServer.cs b/src/Nox.Solution/Models/Infrastructure/Persistence/Search/SearchServer.cs index 880387ef25..3834c1310c 100644 --- a/src/Nox.Solution/Models/Infrastructure/Persistence/Search/SearchServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Persistence/Search/SearchServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution; diff --git a/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Secrets.cs b/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Secrets.cs index bead91aa19..9db30199e9 100644 --- a/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Secrets.cs +++ b/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Secrets.cs @@ -1,5 +1,5 @@ using System.Security.Permissions; -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Server/SecretsServer.cs b/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Server/SecretsServer.cs index ff119b586c..c2be245aa5 100644 --- a/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Server/SecretsServer.cs +++ b/src/Nox.Solution/Models/Infrastructure/Security/Secrets/Server/SecretsServer.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Infrastructure/Security/Secrets/ValidFor/SecretsValidFor.cs b/src/Nox.Solution/Models/Infrastructure/Security/Secrets/ValidFor/SecretsValidFor.cs index 8f916b0d70..f692aa92e6 100644 --- a/src/Nox.Solution/Models/Infrastructure/Security/Secrets/ValidFor/SecretsValidFor.cs +++ b/src/Nox.Solution/Models/Infrastructure/Security/Secrets/ValidFor/SecretsValidFor.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Infrastructure/Security/Security.cs b/src/Nox.Solution/Models/Infrastructure/Security/Security.cs index 748c3fe726..b3e5f2cc14 100644 --- a/src/Nox.Solution/Models/Infrastructure/Security/Security.cs +++ b/src/Nox.Solution/Models/Infrastructure/Security/Security.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/Solution.cs b/src/Nox.Solution/Models/Solution.cs index 0e76bca134..baa31577b4 100644 --- a/src/Nox.Solution/Models/Solution.cs +++ b/src/Nox.Solution/Models/Solution.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System; using System.Collections.Generic; diff --git a/src/Nox.Solution/Models/Team/TeamMember.cs b/src/Nox.Solution/Models/Team/TeamMember.cs index 023482ec36..5436c44f0d 100644 --- a/src/Nox.Solution/Models/Team/TeamMember.cs +++ b/src/Nox.Solution/Models/Team/TeamMember.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System.Collections.Generic; namespace Nox.Solution diff --git a/src/Nox.Solution/Models/Types/TypeOptions/ArrayTypeOptions.cs b/src/Nox.Solution/Models/Types/TypeOptions/ArrayTypeOptions.cs deleted file mode 100644 index bde11f0f18..0000000000 --- a/src/Nox.Solution/Models/Types/TypeOptions/ArrayTypeOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Nox.Solution.Schema; - -namespace Nox.Solution -{ - [Title("Defines the request parameters for a domain query.")] - [Description("The ordered parameters that is the input for the requested query. Can contain simple or complex types")] - [AdditionalProperties(false)] - public class ArrayTypeOptions: NoxSimpleTypeDefinition - { - public ObjectTypeOptions? ObjectTypeOptions { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Nox.Solution/Models/Types/TypeOptions/ObjectTypeOptions.cs b/src/Nox.Solution/Models/Types/TypeOptions/ObjectTypeOptions.cs deleted file mode 100644 index 9033c8c231..0000000000 --- a/src/Nox.Solution/Models/Types/TypeOptions/ObjectTypeOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Nox.Solution.Schema; -using System.Collections.Generic; - -namespace Nox.Solution -{ - public class ObjectTypeOptions : DefinitionBase - { - [Required] - public IReadOnlyList Attributes { get; internal set; } = new List(); - } -} \ No newline at end of file diff --git a/src/Nox.Solution/Models/VersionControl/Folders/VersionControlFolders.cs b/src/Nox.Solution/Models/VersionControl/Folders/VersionControlFolders.cs index 5f27c8e76a..af28a33ba3 100644 --- a/src/Nox.Solution/Models/VersionControl/Folders/VersionControlFolders.cs +++ b/src/Nox.Solution/Models/VersionControl/Folders/VersionControlFolders.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; namespace Nox.Solution { diff --git a/src/Nox.Solution/Models/VersionControl/VersionControl.cs b/src/Nox.Solution/Models/VersionControl/VersionControl.cs index 7a26695fc2..31151501a4 100644 --- a/src/Nox.Solution/Models/VersionControl/VersionControl.cs +++ b/src/Nox.Solution/Models/VersionControl/VersionControl.cs @@ -1,4 +1,4 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; using System; namespace Nox.Solution; diff --git a/src/Nox.Solution/Nox.Solution.csproj b/src/Nox.Solution/Nox.Solution.csproj index 505ba08dfe..01046bdb79 100644 --- a/src/Nox.Solution/Nox.Solution.csproj +++ b/src/Nox.Solution/Nox.Solution.csproj @@ -55,7 +55,7 @@ - + \ No newline at end of file diff --git a/src/Nox.Solution/Schema/Generator/SchemaProperty.cs b/src/Nox.Solution/Schema/Generator/SchemaProperty.cs index d91666bc91..bb22de650d 100644 --- a/src/Nox.Solution/Schema/Generator/SchemaProperty.cs +++ b/src/Nox.Solution/Schema/Generator/SchemaProperty.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using YamlDotNet.Serialization; using Nox.Solution.Extensions; +using Nox.Types.Schema; namespace Nox.Solution.Schema; diff --git a/src/Nox.Solution/Schema/NoxSchemaValidator.cs b/src/Nox.Solution/Schema/NoxSchemaValidator.cs index a190f239e2..86d6f0e1c7 100644 --- a/src/Nox.Solution/Schema/NoxSchemaValidator.cs +++ b/src/Nox.Solution/Schema/NoxSchemaValidator.cs @@ -1,15 +1,10 @@ using System.Collections.Generic; -using System.IO; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization; -using System.Text.Json; using Nox.Solution.Exceptions; using YamlDotNet.Core; using System.Linq; using System; -using Nox.Solution.Extensions; -using System.Collections; -using YamlDotNet.Core.Tokens; namespace Nox.Solution.Schema; diff --git a/src/Nox.Solution/Validation/Base/CollectionTypeOptionsValidator.cs b/src/Nox.Solution/Validation/Base/CollectionTypeOptionsValidator.cs index 97cccc1c55..d04dcb8009 100644 --- a/src/Nox.Solution/Validation/Base/CollectionTypeOptionsValidator.cs +++ b/src/Nox.Solution/Validation/Base/CollectionTypeOptionsValidator.cs @@ -1,4 +1,5 @@ using FluentValidation; +using Nox.Types; namespace Nox.Solution.Validation { diff --git a/src/Nox.Solution/Validation/Base/ObjectTypeOptionsValidator.cs b/src/Nox.Solution/Validation/Base/ObjectTypeOptionsValidator.cs index 2a1810e545..3799c0707e 100644 --- a/src/Nox.Solution/Validation/Base/ObjectTypeOptionsValidator.cs +++ b/src/Nox.Solution/Validation/Base/ObjectTypeOptionsValidator.cs @@ -1,4 +1,5 @@ using FluentValidation; +using Nox.Types; namespace Nox.Solution.Validation { diff --git a/src/Nox.Solution/Validation/Base/SimpleTypeValidator.cs b/src/Nox.Solution/Validation/Base/SimpleTypeValidator.cs index d97c80bcdb..52dccd3e6e 100644 --- a/src/Nox.Solution/Validation/Base/SimpleTypeValidator.cs +++ b/src/Nox.Solution/Validation/Base/SimpleTypeValidator.cs @@ -1,4 +1,5 @@ using FluentValidation; +using Nox.Types; namespace Nox.Solution.Validation { diff --git a/src/Nox.Solution/Schema/Attributes/AdditionalPropertiesAttribute.cs b/src/Nox.Types.Abstractions/Attributes/AdditionalPropertiesAttribute.cs similarity index 93% rename from src/Nox.Solution/Schema/Attributes/AdditionalPropertiesAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/AdditionalPropertiesAttribute.cs index 5b51f4d0a4..dbe9a8688f 100644 --- a/src/Nox.Solution/Schema/Attributes/AdditionalPropertiesAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/AdditionalPropertiesAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, diff --git a/src/Nox.Types/Attributes/CompoundTypeAttribute.cs b/src/Nox.Types.Abstractions/Attributes/CompoundTypeAttribute.cs similarity index 100% rename from src/Nox.Types/Attributes/CompoundTypeAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/CompoundTypeAttribute.cs diff --git a/src/Nox.Solution/Schema/Attributes/DescriptionAttribute.cs b/src/Nox.Types.Abstractions/Attributes/DescriptionAttribute.cs similarity index 93% rename from src/Nox.Solution/Schema/Attributes/DescriptionAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/DescriptionAttribute.cs index 2820f574db..19dcb28b0b 100644 --- a/src/Nox.Solution/Schema/Attributes/DescriptionAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/DescriptionAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, diff --git a/src/Nox.Solution/Schema/Attributes/GenerateJsonSchema.cs b/src/Nox.Types.Abstractions/Attributes/GenerateJsonSchema.cs similarity index 89% rename from src/Nox.Solution/Schema/Attributes/GenerateJsonSchema.cs rename to src/Nox.Types.Abstractions/Attributes/GenerateJsonSchema.cs index 1f5697422a..3e12d0781d 100644 --- a/src/Nox.Solution/Schema/Attributes/GenerateJsonSchema.cs +++ b/src/Nox.Types.Abstractions/Attributes/GenerateJsonSchema.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Class)] public class GenerateJsonSchema : Attribute diff --git a/src/Nox.Solution/Schema/Attributes/IfEqualsAttribute.cs b/src/Nox.Types.Abstractions/Attributes/IfEqualsAttribute.cs similarity index 92% rename from src/Nox.Solution/Schema/Attributes/IfEqualsAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/IfEqualsAttribute.cs index 51c9e70ad7..a28014eb96 100644 --- a/src/Nox.Solution/Schema/Attributes/IfEqualsAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/IfEqualsAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)] public class IfEqualsAttribute : Attribute diff --git a/src/Nox.Solution/Schema/Attributes/IgnoreAttribute.cs b/src/Nox.Types.Abstractions/Attributes/IgnoreAttribute.cs similarity index 86% rename from src/Nox.Solution/Schema/Attributes/IgnoreAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/IgnoreAttribute.cs index 80284f334c..f2834d217a 100644 --- a/src/Nox.Solution/Schema/Attributes/IgnoreAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/IgnoreAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)] public class IgnoreAttribute : Attribute diff --git a/src/Nox.Solution/Schema/Attributes/PatternAttribute.cs b/src/Nox.Types.Abstractions/Attributes/PatternAttribute.cs similarity index 92% rename from src/Nox.Solution/Schema/Attributes/PatternAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/PatternAttribute.cs index 2597b66505..44d5242fd8 100644 --- a/src/Nox.Solution/Schema/Attributes/PatternAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/PatternAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, diff --git a/src/Nox.Solution/Schema/Attributes/RequiredAttribute.cs b/src/Nox.Types.Abstractions/Attributes/RequiredAttribute.cs similarity index 86% rename from src/Nox.Solution/Schema/Attributes/RequiredAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/RequiredAttribute.cs index dc6073d7da..66e4495551 100644 --- a/src/Nox.Solution/Schema/Attributes/RequiredAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/RequiredAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)] public class RequiredAttribute : Attribute diff --git a/src/Nox.Solution/Schema/Attributes/TitleAttribute.cs b/src/Nox.Types.Abstractions/Attributes/TitleAttribute.cs similarity index 92% rename from src/Nox.Solution/Schema/Attributes/TitleAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/TitleAttribute.cs index a9a27df170..2ae4da303e 100644 --- a/src/Nox.Solution/Schema/Attributes/TitleAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/TitleAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Nox.Solution.Schema; +namespace Nox.Types.Schema; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, diff --git a/src/Nox.Types/Enums/CurrencyCode.cs b/src/Nox.Types.Abstractions/Enums/CurrencyCode.cs similarity index 100% rename from src/Nox.Types/Enums/CurrencyCode.cs rename to src/Nox.Types.Abstractions/Enums/CurrencyCode.cs diff --git a/src/Nox.Types/Enums/NoxType.cs b/src/Nox.Types.Abstractions/Enums/NoxType.cs similarity index 100% rename from src/Nox.Types/Enums/NoxType.cs rename to src/Nox.Types.Abstractions/Enums/NoxType.cs diff --git a/src/Nox.Types/Enums/TextTypeCasing.cs b/src/Nox.Types.Abstractions/Enums/TextTypeCasing.cs similarity index 100% rename from src/Nox.Types/Enums/TextTypeCasing.cs rename to src/Nox.Types.Abstractions/Enums/TextTypeCasing.cs diff --git a/src/Nox.Solution/Enums/Ui/IconPosition.cs b/src/Nox.Types.Abstractions/Enums/Ui/IconPosition.cs similarity index 72% rename from src/Nox.Solution/Enums/Ui/IconPosition.cs rename to src/Nox.Types.Abstractions/Enums/Ui/IconPosition.cs index 96afd80f42..90ad334758 100644 --- a/src/Nox.Solution/Enums/Ui/IconPosition.cs +++ b/src/Nox.Types.Abstractions/Enums/Ui/IconPosition.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; namespace Nox { diff --git a/src/Nox.Solution/Enums/Ui/Widget.cs b/src/Nox.Types.Abstractions/Enums/Ui/Widget.cs similarity index 90% rename from src/Nox.Solution/Enums/Ui/Widget.cs rename to src/Nox.Types.Abstractions/Enums/Ui/Widget.cs index 14a7980094..cd4f74f876 100644 --- a/src/Nox.Solution/Enums/Ui/Widget.cs +++ b/src/Nox.Types.Abstractions/Enums/Ui/Widget.cs @@ -1,6 +1,4 @@ -using System; -using System.Linq; - + namespace Nox { public enum Widget diff --git a/src/Nox.Types/Interfaces/INoxType.cs b/src/Nox.Types.Abstractions/Interfaces/INoxType.cs similarity index 100% rename from src/Nox.Types/Interfaces/INoxType.cs rename to src/Nox.Types.Abstractions/Interfaces/INoxType.cs diff --git a/src/Nox.Types/Interfaces/INoxTypeOptions.cs b/src/Nox.Types.Abstractions/Interfaces/INoxTypeOptions.cs similarity index 100% rename from src/Nox.Types/Interfaces/INoxTypeOptions.cs rename to src/Nox.Types.Abstractions/Interfaces/INoxTypeOptions.cs diff --git a/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj b/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj new file mode 100644 index 0000000000..8d94e198fa --- /dev/null +++ b/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj @@ -0,0 +1,16 @@ + + + + netstandard2.0 + 10.0 + enable + Nox + + + + + + + + + diff --git a/src/Nox.Solution/Models/Types/TypeDefinitions/NoxComplexTypeDefinition.cs b/src/Nox.Types.Abstractions/TypeDefinitions/NoxComplexTypeDefinition.cs similarity index 85% rename from src/Nox.Solution/Models/Types/TypeDefinitions/NoxComplexTypeDefinition.cs rename to src/Nox.Types.Abstractions/TypeDefinitions/NoxComplexTypeDefinition.cs index b10c2ec761..1ca86e2456 100644 --- a/src/Nox.Solution/Models/Types/TypeDefinitions/NoxComplexTypeDefinition.cs +++ b/src/Nox.Types.Abstractions/TypeDefinitions/NoxComplexTypeDefinition.cs @@ -1,9 +1,6 @@ -using Nox.Solution.Schema; -using System.Numerics; -using System; -using Nox.Types; +using Nox.Types.Schema; -namespace Nox.Solution; +namespace Nox.Types; [GenerateJsonSchema("dto")] [Title("A complex nox type.")] diff --git a/src/Nox.Solution/Models/Types/TypeDefinitions/NoxSimpleTypeDefinition.cs b/src/Nox.Types.Abstractions/TypeDefinitions/NoxSimpleTypeDefinition.cs similarity index 95% rename from src/Nox.Solution/Models/Types/TypeDefinitions/NoxSimpleTypeDefinition.cs rename to src/Nox.Types.Abstractions/TypeDefinitions/NoxSimpleTypeDefinition.cs index c9c55decc0..78997c2a75 100644 --- a/src/Nox.Solution/Models/Types/TypeDefinitions/NoxSimpleTypeDefinition.cs +++ b/src/Nox.Types.Abstractions/TypeDefinitions/NoxSimpleTypeDefinition.cs @@ -1,13 +1,12 @@ -using Nox.Solution.Schema; -using Nox.Types; +using Nox.Types.Schema; -namespace Nox.Solution; +namespace Nox.Types; [GenerateJsonSchema("type")] [Title("Definition namespace for Nox simple types.")] [Description("Nox simple types definition used throughout Nox.Solution project.")] [AdditionalProperties(false)] -public class NoxSimpleTypeDefinition : DefinitionBase +public class NoxSimpleTypeDefinition { [Required] [Title("The name of the attribute. Contains no spaces.")] diff --git a/src/Nox.Solution/Models/Types/TypeUserInterface/TypeUserInterface.cs b/src/Nox.Types.Abstractions/TypeDefinitions/TypeUserInterface/TypeUserInterface.cs similarity index 97% rename from src/Nox.Solution/Models/Types/TypeUserInterface/TypeUserInterface.cs rename to src/Nox.Types.Abstractions/TypeDefinitions/TypeUserInterface/TypeUserInterface.cs index 6677d62ae3..138801c19a 100644 --- a/src/Nox.Solution/Models/Types/TypeUserInterface/TypeUserInterface.cs +++ b/src/Nox.Types.Abstractions/TypeDefinitions/TypeUserInterface/TypeUserInterface.cs @@ -1,12 +1,12 @@ -using Nox.Solution.Schema; +using Nox.Types.Schema; -namespace Nox.Solution; +namespace Nox.Types; [GenerateJsonSchema] [Title("The user interface display options for this attribute.")] [Description("Specify how this attribute is rendered on the user interface. Configuration options include label, icon, input/output masks, help hints among other.")] [AdditionalProperties(false)] -public class TypeUserInterface : DefinitionBase +public class TypeUserInterface { [Title("A descriptive label for this attribute on the user interface.")] [Description("The text label rendered on the user interface alongside the NoxTextInput component.")] diff --git a/src/Nox.Types.Abstractions/TypeOptions/ArrayTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/ArrayTypeOptions.cs new file mode 100644 index 0000000000..0da84b6d6f --- /dev/null +++ b/src/Nox.Types.Abstractions/TypeOptions/ArrayTypeOptions.cs @@ -0,0 +1,11 @@ +using Nox.Types.Schema; + +namespace Nox.Types; + +[Title("Defines the request parameters for a domain query.")] +[Description("The ordered parameters that is the input for the requested query. Can contain simple or complex types")] +[AdditionalProperties(false)] +public class ArrayTypeOptions: NoxSimpleTypeDefinition +{ + public ObjectTypeOptions? ObjectTypeOptions { get; internal set; } +} \ No newline at end of file diff --git a/src/Nox.Types/Types/Date/DateTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/DateTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Date/DateTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/DateTypeOptions.cs diff --git a/src/Nox.Types/Types/Entity/EntityTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/EntityTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Entity/EntityTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/EntityTypeOptions.cs diff --git a/src/Nox.Types/Types/Money/MoneyTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/MoneyTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Money/MoneyTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/MoneyTypeOptions.cs diff --git a/src/Nox.Types/Types/Number/NumberTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/NumberTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Number/NumberTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/NumberTypeOptions.cs diff --git a/src/Nox.Types.Abstractions/TypeOptions/ObjectTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/ObjectTypeOptions.cs new file mode 100644 index 0000000000..1325461d57 --- /dev/null +++ b/src/Nox.Types.Abstractions/TypeOptions/ObjectTypeOptions.cs @@ -0,0 +1,10 @@ +using Nox.Types.Schema; +using System.Collections.Generic; + +namespace Nox.Types; + +public class ObjectTypeOptions : INoxTypeOptions +{ + [Required] + public IReadOnlyList Attributes { get; internal set; } = new List(); +} \ No newline at end of file diff --git a/src/Nox.Types/Types/Percentage/PercentageTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/PercentageTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Percentage/PercentageTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/PercentageTypeOptions.cs diff --git a/src/Nox.Types/Types/Text/TextTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/TextTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Text/TextTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/TextTypeOptions.cs diff --git a/src/Nox.Types/Types/TranslatedText/TranslatedTextTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/TranslatedTextTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/TranslatedText/TranslatedTextTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/TranslatedTextTypeOptions.cs diff --git a/src/Nox.Types/Types/Year/YearTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/YearTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/Year/YearTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/YearTypeOptions.cs diff --git a/src/Nox.Types/Common/MeasurementUnit.cs b/src/Nox.Types/Common/MeasurementUnit.cs index 5101f1e011..a81eef5807 100644 --- a/src/Nox.Types/Common/MeasurementUnit.cs +++ b/src/Nox.Types/Common/MeasurementUnit.cs @@ -15,10 +15,10 @@ protected MeasurementUnit(int id, string name, string symbol) Symbol = symbol; } - public int CompareTo(object obj) - => Id.CompareTo(((MeasurementUnit)obj).Id); + public int CompareTo(object? obj) + => obj is null ? 0 : Id.CompareTo(((MeasurementUnit)obj).Id); - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is not MeasurementUnit otherValue) { diff --git a/src/Nox.Types/Nox.Types.csproj b/src/Nox.Types/Nox.Types.csproj index feb0d2fb01..6d92af0e23 100644 --- a/src/Nox.Types/Nox.Types.csproj +++ b/src/Nox.Types/Nox.Types.csproj @@ -1,35 +1,51 @@  - - netstandard2.0 - 10.0 - enable - Nox - - - Nox.Types - Andre Sharpe,Jan Schutte - Nox types library - false - Copyright (c) Andre Sharpe 2023 - true - MIT - https://github.com/NoxOrg/Nox - https://github.com/NoxOrg/Nox.Types.git - git - nox.png - - - - - - - - - - True - - - True - + + net7.0 + enable + Nox + + + + Nox.Types + Andre Sharpe,Jan Schutte + Nox types library + false + Copyright (c) Andre Sharpe 2023 + true + MIT + https://github.com/NoxOrg/Nox + https://github.com/NoxOrg/Nox.Types.git + git + nox.png + + + + + + + + + True + + + + True + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Nox.Types/Types/Json/Json.cs b/src/Nox.Types/Types/Json/Json.cs index db433d65f6..1608ddce3a 100644 --- a/src/Nox.Types/Types/Json/Json.cs +++ b/src/Nox.Types/Types/Json/Json.cs @@ -94,7 +94,7 @@ internal override ValidationResult Validate() } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null || obj.GetType() != GetType()) { diff --git a/src/Nox.Types/ValueObjectBase/ValueObject.cs b/src/Nox.Types/ValueObjectBase/ValueObject.cs index f26cbe2678..60f72e71a9 100644 --- a/src/Nox.Types/ValueObjectBase/ValueObject.cs +++ b/src/Nox.Types/ValueObjectBase/ValueObject.cs @@ -74,7 +74,7 @@ protected virtual IEnumerable> GetEqualityComponent yield return new KeyValuePair(nameof(Value), Value!); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null || obj.GetType() != GetType()) { diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs index b95713f7ed..b965cb2912 100644 --- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs +++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs @@ -14,77 +14,77 @@ namespace SampleWebApp.Presentation.Api.OData; /// public class Country : SampleWebApp.Domain.AuditableEntityBase { - public System.String Id { get; set; } = default!; + public string Id { get; set; } = default!; /// /// The country's common name. /// - public System.String Name { get; set; } = default!; + public string Name { get; set; } = default!; /// /// The country's official name. /// - public System.String FormalName { get; set; } = default!; + public string FormalName { get; set; } = default!; /// /// The country's official ISO 4217 alpha-3 code. /// - public System.String AlphaCode3 { get; set; } = default!; + public string AlphaCode3 { get; set; } = default!; /// /// The country's official ISO 4217 alpha-2 code. /// - public System.String AlphaCode2 { get; set; } = default!; + public string AlphaCode2 { get; set; } = default!; /// /// The country's official ISO 4217 alpha-3 code. /// - public System.Double NumericCode { get; set; } = default!; + public string NumericCode { get; set; } = default!; /// /// The country's phone dialing codes (comma-delimited). /// - public System.String? DialingCodes { get; set; } = default!; + public string? DialingCodes { get; set; } = default!; /// /// The capital city of the country. /// - public System.String? Capital { get; set; } = default!; + public string? Capital { get; set; } = default!; /// /// Noun denoting the natives of the country. /// - public System.String? Demonym { get; set; } = default!; + public string? Demonym { get; set; } = default!; /// /// Country area in square kilometers. /// - public System.Double AreaInSquareKilometres { get; set; } = default!; + public string AreaInSquareKilometres { get; set; } = default!; /// /// The region the country is in. /// - public System.String GeoRegion { get; set; } = default!; + public string GeoRegion { get; set; } = default!; /// /// The sub-region the country is in. /// - public System.String GeoSubRegion { get; set; } = default!; + public string GeoSubRegion { get; set; } = default!; /// /// The world region the country is in. /// - public System.String GeoWorldRegion { get; set; } = default!; + public string GeoWorldRegion { get; set; } = default!; /// /// The estimated population of the country. /// - public System.Double? Population { get; set; } = default!; + public string? Population { get; set; } = default!; /// /// The top level internet domains regitered to the country (comma-delimited). /// - public System.String? TopLevelDomains { get; set; } = default!; + public string? TopLevelDomains { get; set; } = default!; } /// @@ -96,12 +96,12 @@ public class Currency : SampleWebApp.Domain.AuditableEntityBase /// /// The currency's primary key / identifier. /// - public System.String Id { get; set; } = default!; + public string Id { get; set; } = default!; /// /// The currency's name. /// - public System.String Name { get; set; } = default!; + public string Name { get; set; } = default!; } /// @@ -113,22 +113,17 @@ public class Store : SampleWebApp.Domain.AuditableEntityBase /// /// Store Primary Key. /// - public System.String Id { get; set; } = default!; + public string Id { get; set; } = default!; /// /// Store Name. /// - public System.String Name { get; set; } = default!; + public string Name { get; set; } = default!; /// /// Physical Money in the Physical Store. /// - public System.Decimal PhysicalMoney_Amount { get; set; } = default!; - - /// - /// Physical Money in the Physical Store. - /// - public System.String PhysicalMoney_CurrencyCode { get; set; } = default!; + public string PhysicalMoney { get; set; } = default!; } /// @@ -136,5 +131,5 @@ public class Store : SampleWebApp.Domain.AuditableEntityBase /// public class CountryLocalNames : SampleWebApp.Domain.AuditableEntityBase { - public System.String Id { get; set; } = default!; + public string Id { get; set; } = default!; } diff --git a/tests/Nox.Tests/ProjectDependencies/CodeAnalysisSolutionFixture.cs b/tests/Nox.Tests/ProjectDependencies/CodeAnalysisSolutionFixture.cs index 7942bbe1e5..a58754404c 100644 --- a/tests/Nox.Tests/ProjectDependencies/CodeAnalysisSolutionFixture.cs +++ b/tests/Nox.Tests/ProjectDependencies/CodeAnalysisSolutionFixture.cs @@ -12,6 +12,7 @@ public class CodeAnalysisSolutionFixture : IAsyncLifetime public Microsoft.CodeAnalysis.Solution Solution { get; private set; } = null!; public ProjectDependencyGraph ProjectDependencyGraph { get; private set; } = null!; + public Project NoxTypesAbstractionsProject { get; private set; } = null!; public Project NoxTypesProject { get; private set; } = null!; public Project NoxSolutionNet7 { get; private set; } = null!; public Project NoxSolutionNetStd20 { get; private set; } = null!; @@ -29,6 +30,7 @@ public async Task InitializeAsync() ProjectDependencyGraph = Solution.GetProjectDependencyGraph(); NoxTypesProject = Solution.Projects.Single(project => project.Name == "Nox.Types"); + NoxTypesAbstractionsProject = Solution.Projects.Single(project => project.Name == "Nox.Types.Abstractions"); NoxSolutionNet7 = Solution.Projects.Single(project => project.Name == "Nox.Solution(net7.0)"); NoxSolutionNetStd20 = Solution.Projects.Single(project => project.Name == "Nox.Solution(netstandard2.0)"); NoxGenerator = Solution.Projects.Single(project => project.Name == "Nox.Generator"); diff --git a/tests/Nox.Tests/ProjectDependencies/ProjectsDependenciesTests.cs b/tests/Nox.Tests/ProjectDependencies/ProjectsDependenciesTests.cs index 1b8c3c3d36..cfd86e881d 100644 --- a/tests/Nox.Tests/ProjectDependencies/ProjectsDependenciesTests.cs +++ b/tests/Nox.Tests/ProjectDependencies/ProjectsDependenciesTests.cs @@ -14,19 +14,19 @@ public ProjectsDependenciesTests(CodeAnalysisSolutionFixture fixture) } [Fact] - public void Nox_Types_Cannot_Reference_Projects() + public void Nox_Types_Abstractions__Cannot_Reference_Projects() { - var projectDependencies = _fixture.ProjectDependencyGraph.GetProjectsThatThisProjectDirectlyDependsOn(_fixture.NoxTypesProject.Id); + var projectDependencies = _fixture.ProjectDependencyGraph.GetProjectsThatThisProjectDirectlyDependsOn(_fixture.NoxTypesAbstractionsProject.Id); projectDependencies.Should().BeEmpty(); //_fixture.NoxTypesProject.ProjectReferences.Should().BeEmpty(); } [Fact] - public void Nox_Types_Cannot_Reference_ThirdParty_Packages() + public void Nox_Types_Abstractions_Cannot_Reference_ThirdParty_Packages() { using (new AssertionScope()) { - foreach (var metadataRef in _fixture.NoxTypesProject.MetadataReferences) + foreach (var metadataRef in _fixture.NoxTypesAbstractionsProject.MetadataReferences) { var properties = metadataRef.Properties; @@ -47,7 +47,7 @@ public void Nox_Types_Cannot_Reference_ThirdParty_Packages() } [Fact] - public void Nox_Solution_References_Nox_Types_Only() + public void Nox_Solution_References_Nox_Types_Abstractions_Only() { var projectDependenciesNoxSolutionNet7 = _fixture.ProjectDependencyGraph.GetProjectsThatThisProjectDirectlyDependsOn(_fixture.NoxSolutionNet7.Id); @@ -57,8 +57,8 @@ public void Nox_Solution_References_Nox_Types_Only() projectDependenciesNoxSolutionNet7.Should().HaveCount(1); projectDependenciesNoxSolutionStd20.Should().HaveCount(1); - (projectDependenciesNoxSolutionNet7.Single() == _fixture.NoxTypesProject.Id).Should().BeTrue(); - (projectDependenciesNoxSolutionStd20.Single() == _fixture.NoxTypesProject.Id).Should().BeTrue(); + (projectDependenciesNoxSolutionNet7.Single() == _fixture.NoxTypesAbstractionsProject.Id).Should().BeTrue(); + (projectDependenciesNoxSolutionStd20.Single() == _fixture.NoxTypesAbstractionsProject.Id).Should().BeTrue(); } [Fact] @@ -72,7 +72,7 @@ public void Nox_Generator_Depends_OnlyOn_Nox_Solution() if (projectDependencies.Count() == 2) { - projectDependencies.Should().Contain(_fixture.NoxTypesProject.Id); + projectDependencies.Should().Contain(_fixture.NoxTypesAbstractionsProject.Id); } } From ccc4f8199cec2b4a4e0a51a238aa708b398445f9 Mon Sep 17 00:00:00 2001 From: Andre Sharpe Date: Mon, 17 Jul 2023 17:54:57 +0200 Subject: [PATCH 2/4] Reorganized type attributes in Nox.Types.Abstractions --- .../Attributes/{ => Shema}/AdditionalPropertiesAttribute.cs | 0 .../Attributes/{ => Shema}/DescriptionAttribute.cs | 0 .../Attributes/{ => Shema}/GenerateJsonSchema.cs | 0 .../Attributes/{ => Shema}/IfEqualsAttribute.cs | 0 .../Attributes/{ => Shema}/IgnoreAttribute.cs | 0 .../Attributes/{ => Shema}/PatternAttribute.cs | 0 .../Attributes/{ => Shema}/RequiredAttribute.cs | 0 .../Attributes/{ => Shema}/TitleAttribute.cs | 0 .../Attributes/{ => Types}/CompoundTypeAttribute.cs | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/AdditionalPropertiesAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/DescriptionAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/GenerateJsonSchema.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/IfEqualsAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/IgnoreAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/PatternAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/RequiredAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Shema}/TitleAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{ => Types}/CompoundTypeAttribute.cs (100%) diff --git a/src/Nox.Types.Abstractions/Attributes/AdditionalPropertiesAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/AdditionalPropertiesAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/AdditionalPropertiesAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/AdditionalPropertiesAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/DescriptionAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/DescriptionAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/DescriptionAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/DescriptionAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/GenerateJsonSchema.cs b/src/Nox.Types.Abstractions/Attributes/Shema/GenerateJsonSchema.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/GenerateJsonSchema.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/GenerateJsonSchema.cs diff --git a/src/Nox.Types.Abstractions/Attributes/IfEqualsAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/IfEqualsAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/IfEqualsAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/IfEqualsAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/IgnoreAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/IgnoreAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/IgnoreAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/IgnoreAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/PatternAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/PatternAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/PatternAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/PatternAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/RequiredAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/RequiredAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/RequiredAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/RequiredAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/TitleAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Shema/TitleAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/TitleAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Shema/TitleAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/CompoundTypeAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Types/CompoundTypeAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/CompoundTypeAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Types/CompoundTypeAttribute.cs From f74ad2f8704d4e53f2d5737d40ba4bba6dc3f47c Mon Sep 17 00:00:00 2001 From: Andre Sharpe Date: Tue, 18 Jul 2023 08:45:31 +0200 Subject: [PATCH 3/4] Implemented NoxType attributes for code Generation. ODataModel refactor. --- src/Nox.Generator/Nox.Generator.cs | 2 +- .../ApiGenerator.OData/ODataModelGenerator.cs | 39 +--- .../Types/CompoundComponentAttribute.cs | 16 ++ .../Attributes/Types/CompoundTypeAttribute.cs | 6 +- .../Attributes/Types/SimpleTypeAttribute.cs | 19 ++ .../Enums/{ => CurrencyCode}/CurrencyCode.cs | 0 .../Enums}/DateTimeDuration/TimeUnit.cs | 0 src/Nox.Types.Abstractions/Enums/NoxType.cs | 156 ++++++++++++- .../Enums/{ => Text}/TextTypeCasing.cs | 0 .../Extensions/NoxTypeExtensions.cs | 55 +++++ .../DateTimeDurationTypeOptions.cs | 0 .../Types/TimeZoneCode/TimeZoneCode.cs | 211 ++---------------- .../ODataModel.g.cs | 47 ++-- 13 files changed, 296 insertions(+), 255 deletions(-) create mode 100644 src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs create mode 100644 src/Nox.Types.Abstractions/Attributes/Types/SimpleTypeAttribute.cs rename src/Nox.Types.Abstractions/Enums/{ => CurrencyCode}/CurrencyCode.cs (100%) rename src/{Nox.Types/Types => Nox.Types.Abstractions/Enums}/DateTimeDuration/TimeUnit.cs (100%) rename src/Nox.Types.Abstractions/Enums/{ => Text}/TextTypeCasing.cs (100%) create mode 100644 src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs rename src/{Nox.Types/Types/DateTimeDuration => Nox.Types.Abstractions/TypeOptions}/DateTimeDurationTypeOptions.cs (100%) diff --git a/src/Nox.Generator/Nox.Generator.cs b/src/Nox.Generator/Nox.Generator.cs index 711ca3f0d4..31dc0d4bae 100644 --- a/src/Nox.Generator/Nox.Generator.cs +++ b/src/Nox.Generator/Nox.Generator.cs @@ -30,7 +30,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) #if DEBUG if (!Debugger.IsAttached) { - // Debugger.Launch(); + // Debugger.Launch(); } #endif // var compilation = context.CompilationProvider.Select((ctx,token) => ctx.GlobalNamespace); diff --git a/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs b/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs index c3fb8b2ef0..ddb855f81e 100644 --- a/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs +++ b/src/Nox.Generator/Presentation/Api/ApiGenerator.OData/ODataModelGenerator.cs @@ -3,7 +3,9 @@ using Nox.Generator.Common; using Nox.Solution; using Nox.Types; +using Nox.Types.Extensions; using System; +using System.Diagnostics; using System.Linq; using static Nox.Generator.Common.BaseGenerator; @@ -99,7 +101,8 @@ private static void GenerateRelationshipProperty(CodeBuilder code, EntityRelatio private static void GenerateProperty(CodeBuilder code, NoxSimpleTypeDefinition attribute, bool forceRequired = false) { - var fields = GetType(attribute.Type); + + var fields = GetNoxTypeInformation(attribute.Type); foreach (var field in fields) { @@ -113,35 +116,11 @@ private static void GenerateProperty(CodeBuilder code, NoxSimpleTypeDefinition a } } - // TODO: refactor the structure - private static Tuple[] GetType(NoxType type) - { - // TODO: add other types - return type switch - { - //NoxType.Text => GetSimpleTypeDefinition(new Text()), - //NoxType.Number => GetSimpleTypeDefinition(new Number()), - - //NoxType.Money => GetMoneyDefinition(), - - _ => new[] { new Tuple(string.Empty, "string") }, - }; - } - - /* - - private static Tuple[] GetSimpleTypeDefinition(ValueObject instance) where TValueObject : ValueObject, new() - { - return new[] { new Tuple(string.Empty, instance.GetUnderlyingType().ToString()) }; - } - - private static Tuple[] GetMoneyDefinition() + private static Tuple[] GetNoxTypeInformation(NoxType noxType) { - var money = new Money(); - return new[] { - new Tuple(nameof(money.Amount), money.Amount.GetType().ToString()), - new Tuple(nameof(money.CurrencyCode), money.CurrencyCode.GetType().ToString()) - }; + return noxType.GetComponents() + .Select( kv => new Tuple(kv.Key, kv.Value.Name)) + .ToArray(); + } - */ } \ No newline at end of file diff --git a/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs new file mode 100644 index 0000000000..fe235e6fe9 --- /dev/null +++ b/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs @@ -0,0 +1,16 @@ +using System; + +namespace Nox.Types; + +[AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] +public class CompoundComponentAttribute : Attribute +{ + public string Name { get; } + public Type UnderlyingType { get; } + public CompoundComponentAttribute(string name, Type type) + { + Name = name; + UnderlyingType = type; + } + +} \ No newline at end of file diff --git a/src/Nox.Types.Abstractions/Attributes/Types/CompoundTypeAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Types/CompoundTypeAttribute.cs index 8ce9f51d36..07e9314613 100644 --- a/src/Nox.Types.Abstractions/Attributes/Types/CompoundTypeAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/Types/CompoundTypeAttribute.cs @@ -5,6 +5,10 @@ namespace Nox.Types; /// /// /// +[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class CompoundTypeAttribute : Attribute { -} \ No newline at end of file + public CompoundTypeAttribute() + { + } +} diff --git a/src/Nox.Types.Abstractions/Attributes/Types/SimpleTypeAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Types/SimpleTypeAttribute.cs new file mode 100644 index 0000000000..dc565dce26 --- /dev/null +++ b/src/Nox.Types.Abstractions/Attributes/Types/SimpleTypeAttribute.cs @@ -0,0 +1,19 @@ +using System; + +namespace Nox.Types; + +/// +/// +/// + +[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] +public class SimpleTypeAttribute : Attribute +{ + + public Type UnderlyingType { get; } + + public SimpleTypeAttribute(Type underlyingType) + { + UnderlyingType = underlyingType; + } +} \ No newline at end of file diff --git a/src/Nox.Types.Abstractions/Enums/CurrencyCode.cs b/src/Nox.Types.Abstractions/Enums/CurrencyCode/CurrencyCode.cs similarity index 100% rename from src/Nox.Types.Abstractions/Enums/CurrencyCode.cs rename to src/Nox.Types.Abstractions/Enums/CurrencyCode/CurrencyCode.cs diff --git a/src/Nox.Types/Types/DateTimeDuration/TimeUnit.cs b/src/Nox.Types.Abstractions/Enums/DateTimeDuration/TimeUnit.cs similarity index 100% rename from src/Nox.Types/Types/DateTimeDuration/TimeUnit.cs rename to src/Nox.Types.Abstractions/Enums/DateTimeDuration/TimeUnit.cs diff --git a/src/Nox.Types.Abstractions/Enums/NoxType.cs b/src/Nox.Types.Abstractions/Enums/NoxType.cs index 1f72ec504e..5094f2e23d 100644 --- a/src/Nox.Types.Abstractions/Enums/NoxType.cs +++ b/src/Nox.Types.Abstractions/Enums/NoxType.cs @@ -1,3 +1,5 @@ +using System; + namespace Nox.Types; public enum NoxType : uint @@ -6,65 +8,201 @@ public enum NoxType : uint Array = 1325194268, Collection = 27417079, Object = 2524865811, - + // Compound Types - requires multiple fields to persist - [CompoundType] Entity = 2276495181, - [CompoundType] LatLong = 4061881939, - [CompoundType] Money = 3500951620, - [CompoundType] StreetAddress = 499179285, - [CompoundType] TranslatedText = 967269030, - [CompoundType] DateTimeRange = 3837929056, - // This is complex, needs to include CountryCode - [CompoundType] VatNumber = 1055627262, + [CompoundType] + [CompoundComponentAttribute("Type", typeof(string))] + [CompoundComponentAttribute("Id", typeof(uint))] + Entity = 2276495181, + + [CompoundType] + [CompoundComponentAttribute("Lattitude",typeof(double))] + [CompoundComponentAttribute("Longitude",typeof(double))] + LatLong = 4061881939, + + [CompoundType] + [CompoundComponentAttribute("Amount", typeof(decimal))] + [CompoundComponentAttribute("CurrencyCode", typeof(string))] + Money = 3500951620, + + [CompoundType] + [CompoundComponentAttribute("StreetNumber",typeof(int))] + [CompoundComponentAttribute("AddressLine1", typeof(string))] + [CompoundComponentAttribute("AddressLine2", typeof(string))] + [CompoundComponentAttribute("AddressLine3", typeof(string))] + [CompoundComponentAttribute("Route", typeof(string))] + [CompoundComponentAttribute("Locality", typeof(string))] + [CompoundComponentAttribute("Neighbourhood", typeof(string))] + [CompoundComponentAttribute("AdministrativeArea1", typeof(string))] + [CompoundComponentAttribute("AdministrativeArea2", typeof(string))] + [CompoundComponentAttribute("PostalCode", typeof(string))] + [CompoundComponentAttribute("CountryCode2", typeof(string))] + StreetAddress = 499179285, + + [CompoundType] + [CompoundComponentAttribute("CultureCode", typeof(string))] + [CompoundComponentAttribute("Phrase", typeof(string))] + TranslatedText = 967269030, + + [CompoundType] + [CompoundComponentAttribute("From", typeof(DateTimeOffset))] + [CompoundComponentAttribute("To", typeof(DateTimeOffset))] + DateTimeRange = 3837929056, + + [CompoundType] + [CompoundComponentAttribute("Number", typeof(string))] + [CompoundComponentAttribute("CountryCode2", typeof(string))] + VatNumber = 1055627262, // Simple Types + [SimpleType(typeof(double))] Area = 998304025, + + [SimpleType(typeof(int))] AutoNumber = 24779567, + + [SimpleType(typeof(bool))] Boolean = 2157507194, + + [SimpleType(typeof(string))] Color = 1567592592, + + [SimpleType(typeof(string))] CountryCode2 = 1658687977, + + [SimpleType(typeof(string))] CountryCode3 = 1150137395, + + [SimpleType(typeof(short))] CountryNumber = 2635883247, + + [SimpleType(typeof(string))] CultureCode = 1724900727, + + [SimpleType(typeof(string))] CurrencyCode = 1132722218, + + [SimpleType(typeof(short))] CurrencyNumber = 2377452890, + + [SimpleType(typeof(DateTime))] Date = 463099971, + + [SimpleType(typeof(byte))] Month = 4186740261, + + [SimpleType(typeof(short))] Year = 3709785124, + + [SimpleType(typeof(DateTime))] DateTime = 2998644573, + + [SimpleType(typeof(TimeSpan))] DateTimeDuration = 2070327063, + + // Propose to store DateTimeSchedule as iCal + // - https://www.rfc-editor.org/rfc/rfc5545 + // - https://github.com/rianjs/ical.net + + [SimpleType(typeof(string))] DateTimeSchedule = 3271762546, + + [SimpleType(typeof(byte))] DayOfWeek = 491349974, + + [SimpleType(typeof(double))] Distance = 1460893529, + + [SimpleType(typeof(string))] Email = 3393987164, + + [SimpleType(typeof(string))] EncryptedText = 1841598137, + + [SimpleType(typeof(string))] File = 612041382, + + [SimpleType(typeof(string))] Formula = 2602269623, + + [SimpleType(typeof(Guid))] Guid = 1043908053, + + [SimpleType(typeof(string))] HashedText = 3656553818, + + [SimpleType(typeof(string))] Html = 2477180992, + + [SimpleType(typeof(string))] Image = 3650429592, + + [SimpleType(typeof(string))] InternetDomain = 1821438912, + + [SimpleType(typeof(string))] IpAddress = 443053997, + + [SimpleType(typeof(string))] Json = 3200665055, + + [SimpleType(typeof(string))] JwtToken = 2477463586, + + [SimpleType(typeof(string))] LanguageCode = 3654380314, + + [SimpleType(typeof(double))] Length = 1024984906, + + [SimpleType(typeof(string))] MacAddress = 404844511, + + [SimpleType(typeof(string))] Markdown = 2745254000, + + [SimpleType(typeof(uint))] Nuid = 3304944825, + + [SimpleType(typeof(uint))] Number = 4223714796, + + [SimpleType(typeof(string))] Password = 1755902638, + + [SimpleType(typeof(float))] Percentage = 3986447473, + + [SimpleType(typeof(string))] PhoneNumber = 3655711066, + + [SimpleType(typeof(float))] Temperature = 1744108624, + + [SimpleType(typeof(string))] Text = 1432028016, + + [SimpleType(typeof(DateTimeOffset))] Time = 2288042805, + + [SimpleType(typeof(string))] TimeZoneCode = 906030230, + + [SimpleType(typeof(string))] Uri = 2293621128, + + [SimpleType(typeof(string))] Url = 2010611594, + + [SimpleType(typeof(string))] User = 2972321043, + + [SimpleType(typeof(double))] Volume = 1729151620, + + [SimpleType(typeof(double))] Weight = 760317285, + + [SimpleType(typeof(string))] Yaml = 3788751714 } \ No newline at end of file diff --git a/src/Nox.Types.Abstractions/Enums/TextTypeCasing.cs b/src/Nox.Types.Abstractions/Enums/Text/TextTypeCasing.cs similarity index 100% rename from src/Nox.Types.Abstractions/Enums/TextTypeCasing.cs rename to src/Nox.Types.Abstractions/Enums/Text/TextTypeCasing.cs diff --git a/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs b/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs new file mode 100644 index 0000000000..2d17be59a3 --- /dev/null +++ b/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using Nox.Types; + +namespace Nox.Types.Extensions; + +public static class NoxTypeExtensions +{ + + private static MemberInfo ToMemberInfo(this NoxType noxType) + { + var memberInfo = typeof(NoxType).GetMember(noxType.ToString()); + var fullMemberInfo = memberInfo.First(m => m.DeclaringType == typeof(NoxType)); + return fullMemberInfo; + } + + public static bool IsSimpleType(this NoxType noxType) + { + return noxType.ToMemberInfo().GetCustomAttribute(false) != null; + } + public static bool IsCompoundType(this NoxType noxType) + { + return noxType.ToMemberInfo().GetCustomAttribute(false) != null; + } + public static IDictionary? GetCompoundComponents(this NoxType noxType) + { + if (noxType.IsCompoundType()) + { + return noxType.ToMemberInfo() + .GetCustomAttributes() + .ToDictionary(c => c.Name, c => c.UnderlyingType); + } + return null; + } + + public static IDictionary? GetComponents(this NoxType noxType) + { + if (noxType.IsSimpleType()) + { + return new Dictionary() + { + { string.Empty, noxType.ToMemberInfo().GetCustomAttribute().UnderlyingType } + }; + + } + else if (noxType.IsCompoundType()) + { + return noxType.GetCompoundComponents(); + } + return new Dictionary(); + } +} diff --git a/src/Nox.Types/Types/DateTimeDuration/DateTimeDurationTypeOptions.cs b/src/Nox.Types.Abstractions/TypeOptions/DateTimeDurationTypeOptions.cs similarity index 100% rename from src/Nox.Types/Types/DateTimeDuration/DateTimeDurationTypeOptions.cs rename to src/Nox.Types.Abstractions/TypeOptions/DateTimeDurationTypeOptions.cs diff --git a/src/Nox.Types/Types/TimeZoneCode/TimeZoneCode.cs b/src/Nox.Types/Types/TimeZoneCode/TimeZoneCode.cs index 2152190ea3..d525b2b248 100644 --- a/src/Nox.Types/Types/TimeZoneCode/TimeZoneCode.cs +++ b/src/Nox.Types/Types/TimeZoneCode/TimeZoneCode.cs @@ -9,199 +9,24 @@ namespace Nox.Types; public sealed class TimeZoneCode : ValueObject { private static readonly HashSet _timeZoneCodes = new() { - "ACDT", - "ACST", - "ACT", - "ADT", - "AEDT", - "AEST", - "AET", - "AFT", - "AKDT", - "AKST", - "ALMT", - "AMST", - "AMT", - "ANAT", - "AQTT", - "ART", - "AST", - "AWST", - "AZOST", - "AZOT", - "AZT", - "BNT", - "BIOT", - "BIT", - "BOT", - "BRST", - "BRT", - "BST", - "BTT", - "CAT", - "CCT", - "CDT", - "CEST", - "CET", - "CHADT", - "CHAST", - "CHOT", - "CHOST", - "CHST", - "CHUT", - "CIST", - "CKT", - "CLST", - "CLT", - "COST", - "COT", - "CST", - "CT", - "CVT", - "CWST", - "CXT", - "DAVT", - "DDUT", - "DFT", - "EASST", - "EAST", - "EAT", - "ECT", - "EDT", - "EEST", - "EET", - "EGST", - "EGT", - "EST", - "ET", - "FET", - "FJT", - "FKST", - "FKT", - "FNT", - "GALT", - "GAMT", - "GET", - "GFT", - "GILT", - "GIT", - "GMT", - "GST", - "GYT", - "HDT", - "HAEC", - "HST", - "HKT", - "HMT", - "HOVST", - "HOVT", - "ICT", - "IDLW", - "IDT", - "IOT", - "IRDT", - "IRKT", - "IRST", - "IST", - "JST", - "KALT", - "KGT", - "KOST", - "KRAT", - "KST", - "LHST", - "LINT", - "MAGT", - "MART", - "MAWT", - "MDT", - "MET", - "MEST", - "MHT", - "MIST", - "MIT", - "MMT", - "MSK", - "MST", - "MUT", - "MVT", - "MYT", - "NCT", - "NDT", - "NFT", - "NOVT", - "NPT", - "NST", - "NT", - "NUT", - "NZDT", - "NZST", - "OMST", - "ORAT", - "PDT", - "PET", - "PETT", - "PGT", - "PHOT", - "PHT", - "PHST", - "PKT", - "PMDT", - "PMST", - "PONT", - "PST", - "PWT", - "PYST", - "PYT", - "RET", - "ROTT", - "SAKT", - "SAMT", - "SAST", - "SBT", - "SCT", - "SDT", - "SGT", - "SLST", - "SRET", - "SRT", - "SST", - "SYOT", - "TAHT", - "THA", - "TFT", - "TJT", - "TKT", - "TLT", - "TMT", - "TRT", - "TOT", - "TVT", - "ULAST", - "ULAT", - "UTC", - "UYST", - "UYT", - "UZT", - "VET", - "VLAT", - "VOLT", - "VOST", - "VUT", - "WAKT", - "WAST", - "WAT", - "WEST", - "WET", - "WIB", - "WIT", - "WITA", - "WGST", - "WGT", - "WST", - "YAKT", - "YEKT"}; - + "ACDT","ACST","ACT","ADT","AEDT","AEST","AET","AFT","AKDT","AKST","ALMT", + "AMST","AMT","ANAT","AQTT","ART","AST","AWST","AZOST","AZOT","AZT","BNT", + "BIOT","BIT","BOT","BRST","BRT","BST","BTT","CAT","CCT","CDT","CEST","CET", + "CHADT","CHAST","CHOT","CHOST","CHST","CHUT","CIST","CKT","CLST","CLT","COST", + "COT","CST","CT","CVT","CWST","CXT","DAVT","DDUT","DFT","EASST","EAST","EAT", + "ECT","EDT","EEST","EET","EGST","EGT","EST","ET","FET","FJT","FKST","FKT", + "FNT","GALT","GAMT","GET","GFT","GILT","GIT","GMT","GST","GYT","HDT","HAEC", + "HST","HKT","HMT","HOVST","HOVT","ICT","IDLW","IDT","IOT","IRDT","IRKT","IRST", + "IST","JST","KALT","KGT","KOST","KRAT","KST","LHST","LINT","MAGT","MART","MAWT", + "MDT","MET","MEST","MHT","MIST","MIT","MMT","MSK","MST","MUT","MVT","MYT", + "NCT","NDT","NFT","NOVT","NPT","NST","NT","NUT","NZDT","NZST","OMST", + "ORAT","PDT","PET","PETT","PGT","PHOT","PHT","PHST","PKT","PMDT","PMST", + "PONT","PST","PWT","PYST","PYT","RET","ROTT","SAKT","SAMT","SAST","SBT","SCT", + "SDT","SGT","SLST","SRET","SRT","SST","SYOT","TAHT","THA","TFT","TJT","TKT", + "TLT","TMT","TRT","TOT","TVT","ULAST","ULAT","UTC","UYST","UYT","UZT","VET", + "VLAT","VOLT","VOST","VUT","WAKT","WAST","WAT","WEST","WET","WIB","WIT","WITA", + "WGST","WGT","WST","YAKT","YEKT" + }; /// /// Sets the value to upper case with invariant culture. /// diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs index b965cb2912..78493d7ec0 100644 --- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs +++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/ODataModel.g.cs @@ -14,77 +14,77 @@ namespace SampleWebApp.Presentation.Api.OData; /// public class Country : SampleWebApp.Domain.AuditableEntityBase { - public string Id { get; set; } = default!; + public String Id { get; set; } = default!; /// /// The country's common name. /// - public string Name { get; set; } = default!; + public String Name { get; set; } = default!; /// /// The country's official name. /// - public string FormalName { get; set; } = default!; + public String FormalName { get; set; } = default!; /// /// The country's official ISO 4217 alpha-3 code. /// - public string AlphaCode3 { get; set; } = default!; + public String AlphaCode3 { get; set; } = default!; /// /// The country's official ISO 4217 alpha-2 code. /// - public string AlphaCode2 { get; set; } = default!; + public String AlphaCode2 { get; set; } = default!; /// /// The country's official ISO 4217 alpha-3 code. /// - public string NumericCode { get; set; } = default!; + public UInt32 NumericCode { get; set; } = default!; /// /// The country's phone dialing codes (comma-delimited). /// - public string? DialingCodes { get; set; } = default!; + public String? DialingCodes { get; set; } = default!; /// /// The capital city of the country. /// - public string? Capital { get; set; } = default!; + public String? Capital { get; set; } = default!; /// /// Noun denoting the natives of the country. /// - public string? Demonym { get; set; } = default!; + public String? Demonym { get; set; } = default!; /// /// Country area in square kilometers. /// - public string AreaInSquareKilometres { get; set; } = default!; + public UInt32 AreaInSquareKilometres { get; set; } = default!; /// /// The region the country is in. /// - public string GeoRegion { get; set; } = default!; + public String GeoRegion { get; set; } = default!; /// /// The sub-region the country is in. /// - public string GeoSubRegion { get; set; } = default!; + public String GeoSubRegion { get; set; } = default!; /// /// The world region the country is in. /// - public string GeoWorldRegion { get; set; } = default!; + public String GeoWorldRegion { get; set; } = default!; /// /// The estimated population of the country. /// - public string? Population { get; set; } = default!; + public UInt32? Population { get; set; } = default!; /// /// The top level internet domains regitered to the country (comma-delimited). /// - public string? TopLevelDomains { get; set; } = default!; + public String? TopLevelDomains { get; set; } = default!; } /// @@ -96,12 +96,12 @@ public class Currency : SampleWebApp.Domain.AuditableEntityBase /// /// The currency's primary key / identifier. /// - public string Id { get; set; } = default!; + public String Id { get; set; } = default!; /// /// The currency's name. /// - public string Name { get; set; } = default!; + public String Name { get; set; } = default!; } /// @@ -113,17 +113,22 @@ public class Store : SampleWebApp.Domain.AuditableEntityBase /// /// Store Primary Key. /// - public string Id { get; set; } = default!; + public String Id { get; set; } = default!; /// /// Store Name. /// - public string Name { get; set; } = default!; + public String Name { get; set; } = default!; /// /// Physical Money in the Physical Store. /// - public string PhysicalMoney { get; set; } = default!; + public Decimal PhysicalMoney_Amount { get; set; } = default!; + + /// + /// Physical Money in the Physical Store. + /// + public String PhysicalMoney_CurrencyCode { get; set; } = default!; } /// @@ -131,5 +136,5 @@ public class Store : SampleWebApp.Domain.AuditableEntityBase /// public class CountryLocalNames : SampleWebApp.Domain.AuditableEntityBase { - public string Id { get; set; } = default!; + public String Id { get; set; } = default!; } From ee3c505589b04b5d9b7e4bcf9343102f66793745 Mon Sep 17 00:00:00 2001 From: Andre Sharpe Date: Tue, 18 Jul 2023 09:07:48 +0200 Subject: [PATCH 4/4] Applied review comments --- .../AdditionalPropertiesAttribute.cs | 0 .../{Shema => Schema}/DescriptionAttribute.cs | 0 .../{Shema => Schema}/GenerateJsonSchema.cs | 0 .../{Shema => Schema}/IfEqualsAttribute.cs | 0 .../{Shema => Schema}/IgnoreAttribute.cs | 0 .../{Shema => Schema}/PatternAttribute.cs | 0 .../{Shema => Schema}/RequiredAttribute.cs | 0 .../{Shema => Schema}/TitleAttribute.cs | 0 .../Types/CompoundComponentAttribute.cs | 4 +- src/Nox.Types.Abstractions/Enums/NoxType.cs | 46 +++++++++---------- .../Extensions/NoxTypeExtensions.cs | 2 +- .../Nox.Types.Abstractions.csproj | 8 ++++ 12 files changed, 34 insertions(+), 26 deletions(-) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/AdditionalPropertiesAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/DescriptionAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/GenerateJsonSchema.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/IfEqualsAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/IgnoreAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/PatternAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/RequiredAttribute.cs (100%) rename src/Nox.Types.Abstractions/Attributes/{Shema => Schema}/TitleAttribute.cs (100%) diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/AdditionalPropertiesAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/AdditionalPropertiesAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/AdditionalPropertiesAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/AdditionalPropertiesAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/DescriptionAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/DescriptionAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/DescriptionAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/DescriptionAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/GenerateJsonSchema.cs b/src/Nox.Types.Abstractions/Attributes/Schema/GenerateJsonSchema.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/GenerateJsonSchema.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/GenerateJsonSchema.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/IfEqualsAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/IfEqualsAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/IfEqualsAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/IfEqualsAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/IgnoreAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/IgnoreAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/IgnoreAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/IgnoreAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/PatternAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/PatternAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/PatternAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/PatternAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/RequiredAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/RequiredAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/RequiredAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/RequiredAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Shema/TitleAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Schema/TitleAttribute.cs similarity index 100% rename from src/Nox.Types.Abstractions/Attributes/Shema/TitleAttribute.cs rename to src/Nox.Types.Abstractions/Attributes/Schema/TitleAttribute.cs diff --git a/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs b/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs index fe235e6fe9..5d56b6cdcc 100644 --- a/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs +++ b/src/Nox.Types.Abstractions/Attributes/Types/CompoundComponentAttribute.cs @@ -3,11 +3,11 @@ namespace Nox.Types; [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] -public class CompoundComponentAttribute : Attribute +public class CompoundComponent : Attribute { public string Name { get; } public Type UnderlyingType { get; } - public CompoundComponentAttribute(string name, Type type) + public CompoundComponent(string name, Type type) { Name = name; UnderlyingType = type; diff --git a/src/Nox.Types.Abstractions/Enums/NoxType.cs b/src/Nox.Types.Abstractions/Enums/NoxType.cs index 5094f2e23d..e2989ce8e1 100644 --- a/src/Nox.Types.Abstractions/Enums/NoxType.cs +++ b/src/Nox.Types.Abstractions/Enums/NoxType.cs @@ -11,47 +11,47 @@ public enum NoxType : uint // Compound Types - requires multiple fields to persist [CompoundType] - [CompoundComponentAttribute("Type", typeof(string))] - [CompoundComponentAttribute("Id", typeof(uint))] + [CompoundComponent("Type", typeof(string))] + [CompoundComponent("Id", typeof(uint))] Entity = 2276495181, [CompoundType] - [CompoundComponentAttribute("Lattitude",typeof(double))] - [CompoundComponentAttribute("Longitude",typeof(double))] + [CompoundComponent("Lattitude",typeof(double))] + [CompoundComponent("Longitude",typeof(double))] LatLong = 4061881939, [CompoundType] - [CompoundComponentAttribute("Amount", typeof(decimal))] - [CompoundComponentAttribute("CurrencyCode", typeof(string))] + [CompoundComponent("Amount", typeof(decimal))] + [CompoundComponent("CurrencyCode", typeof(string))] Money = 3500951620, [CompoundType] - [CompoundComponentAttribute("StreetNumber",typeof(int))] - [CompoundComponentAttribute("AddressLine1", typeof(string))] - [CompoundComponentAttribute("AddressLine2", typeof(string))] - [CompoundComponentAttribute("AddressLine3", typeof(string))] - [CompoundComponentAttribute("Route", typeof(string))] - [CompoundComponentAttribute("Locality", typeof(string))] - [CompoundComponentAttribute("Neighbourhood", typeof(string))] - [CompoundComponentAttribute("AdministrativeArea1", typeof(string))] - [CompoundComponentAttribute("AdministrativeArea2", typeof(string))] - [CompoundComponentAttribute("PostalCode", typeof(string))] - [CompoundComponentAttribute("CountryCode2", typeof(string))] + [CompoundComponent("StreetNumber",typeof(int))] + [CompoundComponent("AddressLine1", typeof(string))] + [CompoundComponent("AddressLine2", typeof(string))] + [CompoundComponent("AddressLine3", typeof(string))] + [CompoundComponent("Route", typeof(string))] + [CompoundComponent("Locality", typeof(string))] + [CompoundComponent("Neighbourhood", typeof(string))] + [CompoundComponent("AdministrativeArea1", typeof(string))] + [CompoundComponent("AdministrativeArea2", typeof(string))] + [CompoundComponent("PostalCode", typeof(string))] + [CompoundComponent("CountryCode2", typeof(string))] StreetAddress = 499179285, [CompoundType] - [CompoundComponentAttribute("CultureCode", typeof(string))] - [CompoundComponentAttribute("Phrase", typeof(string))] + [CompoundComponent("CultureCode", typeof(string))] + [CompoundComponent("Phrase", typeof(string))] TranslatedText = 967269030, [CompoundType] - [CompoundComponentAttribute("From", typeof(DateTimeOffset))] - [CompoundComponentAttribute("To", typeof(DateTimeOffset))] + [CompoundComponent("From", typeof(DateTimeOffset))] + [CompoundComponent("To", typeof(DateTimeOffset))] DateTimeRange = 3837929056, [CompoundType] - [CompoundComponentAttribute("Number", typeof(string))] - [CompoundComponentAttribute("CountryCode2", typeof(string))] + [CompoundComponent("Number", typeof(string))] + [CompoundComponent("CountryCode2", typeof(string))] VatNumber = 1055627262, // Simple Types diff --git a/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs b/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs index 2d17be59a3..e53f8d8ea0 100644 --- a/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs +++ b/src/Nox.Types.Abstractions/Extensions/NoxTypeExtensions.cs @@ -30,7 +30,7 @@ public static bool IsCompoundType(this NoxType noxType) if (noxType.IsCompoundType()) { return noxType.ToMemberInfo() - .GetCustomAttributes() + .GetCustomAttributes() .ToDictionary(c => c.Name, c => c.UnderlyingType); } return null; diff --git a/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj b/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj index 8d94e198fa..370e86bc2b 100644 --- a/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj +++ b/src/Nox.Types.Abstractions/Nox.Types.Abstractions.csproj @@ -13,4 +13,12 @@ + + True + + + + True + +