From e0dd0abf03183a59d5cc37600aea609642f68038 Mon Sep 17 00:00:00 2001 From: Zeynep Delal Mutlu Date: Mon, 16 Nov 2026 11:26:58 +0100 Subject: [PATCH 1/5] Core dto validator is added. --- CLAUDE.md | 2 +- .../AnnotatingElementValidator.cs | 50 ++++++ .../AssociationValidator.cs | 54 ++++++ .../DependencyValidator.cs | 62 +++++++ .../EnumerationDefinitionValidator.cs | 50 ++++++ .../FeatureTypingValidator.cs | 56 +++++++ .../AutoGenDtoValidators/FeatureValidator.cs | 52 ++++++ .../AutoGenDtoValidators/FlowValidator.cs | 56 +++++++ .../FramedConcernMembershipValidator.cs | 58 +++++++ .../LiteralIntegerValidator.cs | 52 ++++++ .../LiteralRationalValidator.cs | 52 ++++++ .../MembershipValidator.cs | 57 +++++++ .../MultiplicityRangeValidator.cs | 52 ++++++ .../OwningMembershipValidator.cs | 56 +++++++ .../ReferenceSubsettingValidator.cs | 55 +++++++ .../RequirementUsageValidator.cs | 54 ++++++ .../SelectExpressionValidator.cs | 53 ++++++ .../SubclassificationValidator.cs | 56 +++++++ .../TextualRepresentationValidator.cs | 52 ++++++ .../AutoGenDtoValidators/UsageValidator.cs | 52 ++++++ ...UmlCoreDtoValidatorGeneratorTestFixture.cs | 62 +++++++ .../DtoValidatorHelperTestFixture.cs | 85 ++++++++++ .../UmlCoreDtoValidatorGenerator.cs | 154 ++++++++++++++++++ .../HandleBarHelpers/DtoValidatorHelper.cs | 152 +++++++++++++++++ .../SysML2.NET.CodeGenerator.csproj | 3 + .../Uml/core-dto-validator-uml-template.hbs | 44 +++++ .../FeatureValidatorTestFixture.cs | 41 +++++ .../LiteralStringValidatorTestFixture.cs | 40 +++++ .../MembershipValidatorTestFixture.cs | 81 +++++++++ ...onstraintMembershipValidatorTestFixture.cs | 37 +++++ .../Core/DTO/DtoValidatorTestFixture.cs | 60 +++++++ .../AcceptActionUsageValidator.cs | 54 ++++++ .../ActionDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/ActionUsageValidator.cs | 54 ++++++ .../ActorMembershipValidator.cs | 56 +++++++ .../AllocationDefinitionValidator.cs | 54 ++++++ .../AllocationUsageValidator.cs | 58 +++++++ .../AnalysisCaseDefinitionValidator.cs | 50 ++++++ .../AnalysisCaseUsageValidator.cs | 54 ++++++ .../AnnotatingElementValidator.cs | 50 ++++++ .../AutoGenValidator/AnnotationValidator.cs | 55 +++++++ .../AssertConstraintUsageValidator.cs | 54 ++++++ .../AssignmentActionUsageValidator.cs | 54 ++++++ .../AssociationStructureValidator.cs | 54 ++++++ .../AutoGenValidator/AssociationValidator.cs | 54 ++++++ .../AttributeDefinitionValidator.cs | 50 ++++++ .../AttributeUsageValidator.cs | 52 ++++++ .../DTO/AutoGenValidator/BehaviorValidator.cs | 50 ++++++ .../BindingConnectorAsUsageValidator.cs | 56 +++++++ .../BindingConnectorValidator.cs | 56 +++++++ .../BooleanExpressionValidator.cs | 52 ++++++ .../CalculationDefinitionValidator.cs | 50 ++++++ .../CalculationUsageValidator.cs | 54 ++++++ .../CaseDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/CaseUsageValidator.cs | 54 ++++++ .../DTO/AutoGenValidator/ClassValidator.cs | 50 ++++++ .../AutoGenValidator/ClassifierValidator.cs | 50 ++++++ .../CollectExpressionValidator.cs | 53 ++++++ .../DTO/AutoGenValidator/CommentValidator.cs | 51 ++++++ .../ConcernDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/ConcernUsageValidator.cs | 54 ++++++ .../ConjugatedPortDefinitionValidator.cs | 50 ++++++ .../ConjugatedPortTypingValidator.cs | 56 +++++++ .../AutoGenValidator/ConjugationValidator.cs | 56 +++++++ .../ConnectionDefinitionValidator.cs | 54 ++++++ .../ConnectionUsageValidator.cs | 58 +++++++ .../AutoGenValidator/ConnectorValidator.cs | 56 +++++++ .../ConstraintDefinitionValidator.cs | 50 ++++++ .../ConstraintUsageValidator.cs | 54 ++++++ .../ConstructorExpressionValidator.cs | 52 ++++++ .../CrossSubsettingValidator.cs | 55 +++++++ .../DTO/AutoGenValidator/DataTypeValidator.cs | 50 ++++++ .../AutoGenValidator/DecisionNodeValidator.cs | 54 ++++++ .../AutoGenValidator/DefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/DependencyValidator.cs | 62 +++++++ .../AutoGenValidator/DifferencingValidator.cs | 55 +++++++ .../AutoGenValidator/DisjoiningValidator.cs | 56 +++++++ .../DocumentationValidator.cs | 51 ++++++ .../ElementFilterMembershipValidator.cs | 56 +++++++ .../EndFeatureMembershipValidator.cs | 56 +++++++ .../EnumerationDefinitionValidator.cs | 50 ++++++ .../EnumerationUsageValidator.cs | 52 ++++++ .../EventOccurrenceUsageValidator.cs | 54 ++++++ .../ExhibitStateUsageValidator.cs | 54 ++++++ .../AutoGenValidator/ExpressionValidator.cs | 52 ++++++ .../FeatureChainExpressionValidator.cs | 53 ++++++ .../FeatureChainingValidator.cs | 55 +++++++ .../FeatureInvertingValidator.cs | 56 +++++++ .../FeatureMembershipValidator.cs | 56 +++++++ .../FeatureReferenceExpressionValidator.cs | 52 ++++++ .../FeatureTypingValidator.cs | 56 +++++++ .../DTO/AutoGenValidator/FeatureValidator.cs | 52 ++++++ .../AutoGenValidator/FeatureValueValidator.cs | 56 +++++++ .../FlowDefinitionValidator.cs | 54 ++++++ .../DTO/AutoGenValidator/FlowEndValidator.cs | 52 ++++++ .../AutoGenValidator/FlowUsageValidator.cs | 58 +++++++ .../DTO/AutoGenValidator/FlowValidator.cs | 56 +++++++ .../ForLoopActionUsageValidator.cs | 54 ++++++ .../DTO/AutoGenValidator/ForkNodeValidator.cs | 54 ++++++ .../FramedConcernMembershipValidator.cs | 58 +++++++ .../DTO/AutoGenValidator/FunctionValidator.cs | 50 ++++++ .../IfActionUsageValidator.cs | 54 ++++++ .../IncludeUseCaseUsageValidator.cs | 54 ++++++ .../IndexExpressionValidator.cs | 53 ++++++ .../AutoGenValidator/InteractionValidator.cs | 54 ++++++ .../InterfaceDefinitionValidator.cs | 54 ++++++ .../InterfaceUsageValidator.cs | 58 +++++++ .../AutoGenValidator/IntersectingValidator.cs | 55 +++++++ .../AutoGenValidator/InvariantValidator.cs | 52 ++++++ .../InvocationExpressionValidator.cs | 52 ++++++ .../ItemDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/ItemUsageValidator.cs | 54 ++++++ .../DTO/AutoGenValidator/JoinNodeValidator.cs | 54 ++++++ .../LibraryPackageValidator.cs | 50 ++++++ .../LiteralBooleanValidator.cs | 52 ++++++ .../LiteralExpressionValidator.cs | 52 ++++++ .../LiteralInfinityValidator.cs | 52 ++++++ .../LiteralIntegerValidator.cs | 52 ++++++ .../LiteralRationalValidator.cs | 52 ++++++ .../LiteralStringValidator.cs | 53 ++++++ .../MembershipExposeValidator.cs | 57 +++++++ .../MembershipImportValidator.cs | 57 +++++++ .../AutoGenValidator/MembershipValidator.cs | 57 +++++++ .../AutoGenValidator/MergeNodeValidator.cs | 54 ++++++ .../AutoGenValidator/MetaclassValidator.cs | 50 ++++++ .../MetadataAccessExpressionValidator.cs | 52 ++++++ .../MetadataDefinitionValidator.cs | 50 ++++++ .../MetadataFeatureValidator.cs | 52 ++++++ .../MetadataUsageValidator.cs | 54 ++++++ .../MultiplicityRangeValidator.cs | 52 ++++++ .../AutoGenValidator/MultiplicityValidator.cs | 52 ++++++ .../NamespaceExposeValidator.cs | 57 +++++++ .../NamespaceImportValidator.cs | 57 +++++++ .../AutoGenValidator/NamespaceValidator.cs | 50 ++++++ .../NullExpressionValidator.cs | 52 ++++++ .../ObjectiveMembershipValidator.cs | 56 +++++++ .../OccurrenceDefinitionValidator.cs | 50 ++++++ .../OccurrenceUsageValidator.cs | 54 ++++++ .../OperatorExpressionValidator.cs | 53 ++++++ .../OwningMembershipValidator.cs | 56 +++++++ .../DTO/AutoGenValidator/PackageValidator.cs | 50 ++++++ .../ParameterMembershipValidator.cs | 56 +++++++ .../PartDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/PartUsageValidator.cs | 54 ++++++ .../PayloadFeatureValidator.cs | 52 ++++++ .../PerformActionUsageValidator.cs | 54 ++++++ .../PortConjugationValidator.cs | 56 +++++++ .../PortDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/PortUsageValidator.cs | 54 ++++++ .../AutoGenValidator/PredicateValidator.cs | 50 ++++++ .../AutoGenValidator/RedefinitionValidator.cs | 56 +++++++ .../ReferenceSubsettingValidator.cs | 55 +++++++ .../ReferenceUsageValidator.cs | 52 ++++++ .../RenderingDefinitionValidator.cs | 50 ++++++ .../RenderingUsageValidator.cs | 54 ++++++ ...equirementConstraintMembershipValidator.cs | 58 +++++++ .../RequirementDefinitionValidator.cs | 50 ++++++ .../RequirementUsageValidator.cs | 54 ++++++ ...uirementVerificationMembershipValidator.cs | 58 +++++++ .../ResultExpressionMembershipValidator.cs | 56 +++++++ .../ReturnParameterMembershipValidator.cs | 56 +++++++ .../SatisfyRequirementUsageValidator.cs | 54 ++++++ .../SelectExpressionValidator.cs | 53 ++++++ .../SendActionUsageValidator.cs | 54 ++++++ .../SpecializationValidator.cs | 56 +++++++ .../StakeholderMembershipValidator.cs | 56 +++++++ .../StateDefinitionValidator.cs | 50 ++++++ .../StateSubactionMembershipValidator.cs | 58 +++++++ .../AutoGenValidator/StateUsageValidator.cs | 54 ++++++ .../DTO/AutoGenValidator/StepValidator.cs | 52 ++++++ .../AutoGenValidator/StructureValidator.cs | 50 ++++++ .../SubclassificationValidator.cs | 56 +++++++ .../SubjectMembershipValidator.cs | 56 +++++++ .../AutoGenValidator/SubsettingValidator.cs | 56 +++++++ .../SuccessionAsUsageValidator.cs | 56 +++++++ .../SuccessionFlowUsageValidator.cs | 58 +++++++ .../SuccessionFlowValidator.cs | 56 +++++++ .../AutoGenValidator/SuccessionValidator.cs | 56 +++++++ .../TerminateActionUsageValidator.cs | 54 ++++++ .../TextualRepresentationValidator.cs | 52 ++++++ .../TransitionFeatureMembershipValidator.cs | 58 +++++++ .../TransitionUsageValidator.cs | 54 ++++++ .../TriggerInvocationExpressionValidator.cs | 54 ++++++ .../TypeFeaturingValidator.cs | 56 +++++++ .../DTO/AutoGenValidator/TypeValidator.cs | 50 ++++++ .../DTO/AutoGenValidator/UnioningValidator.cs | 55 +++++++ .../DTO/AutoGenValidator/UsageValidator.cs | 52 ++++++ .../UseCaseDefinitionValidator.cs | 50 ++++++ .../AutoGenValidator/UseCaseUsageValidator.cs | 54 ++++++ .../VariantMembershipValidator.cs | 56 +++++++ .../VerificationCaseDefinitionValidator.cs | 50 ++++++ .../VerificationCaseUsageValidator.cs | 54 ++++++ .../ViewDefinitionValidator.cs | 50 ++++++ .../ViewRenderingMembershipValidator.cs | 56 +++++++ .../AutoGenValidator/ViewUsageValidator.cs | 54 ++++++ .../ViewpointDefinitionValidator.cs | 50 ++++++ .../ViewpointUsageValidator.cs | 54 ++++++ .../WhileLoopActionUsageValidator.cs | 54 ++++++ .../Core/DTO/DtoValidator.cs | 51 ++++++ .../SysML2.NET.Validation.csproj | 2 +- SysML2.NET/PIM/DTO/Project.cs | 2 +- 201 files changed, 10792 insertions(+), 3 deletions(-) create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs create mode 100644 SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGenerator.cs create mode 100644 SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs create mode 100644 SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/FeatureValidatorTestFixture.cs create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/LiteralStringValidatorTestFixture.cs create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/DtoValidatorTestFixture.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs create mode 100644 SysML2.NET.Validation/Core/DTO/DtoValidator.cs diff --git a/CLAUDE.md b/CLAUDE.md index 6b422706a..db7cf80f6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -141,7 +141,7 @@ SysML2.NET.Serializer.TextualNotation - Writers/, AutoGenTextualNotationBuilder/ SysML2.NET.Dal - Data Access Layer (Assembler, ElementFactory) SysML2.NET.REST - REST client + Session SysML2.NET.Kpar - Reader/Writer for .kpar archives -SysML2.NET.Validation - FluentValidation validators for the PSM request DTOs (PSM/AutoGenValidator/, generated) +SysML2.NET.Validation - FluentValidation validators for the PSM request DTOs (PSM/AutoGenValidator/) and the Core DTOs (Core/DTO/AutoGenValidator/), generated SysML2.NET.Viewer - Blazor WebAssembly app (net9.0) SysML2.NET.CodeGenerator - Code generation tool (net10.0, not packaged) ``` diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs new file mode 100644 index 000000000..4d66e4678 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AnnotatingElementValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AnnotatingElementValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs new file mode 100644 index 000000000..5c85533a5 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Associations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Association metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AssociationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AssociationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs new file mode 100644 index 000000000..5ca9ea19c --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs @@ -0,0 +1,62 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Dependencies; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Dependency metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DependencyValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DependencyValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Client).NotNull(); + this.RuleFor(dto => dto.Client).Must(value => value == null || value.Count >= 1); + this.RuleFor(dto => dto.Client).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.Client).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Supplier).NotNull(); + this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Count >= 1); + this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.Supplier).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs new file mode 100644 index 000000000..5d5599816 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Enumerations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class EnumerationDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public EnumerationDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs new file mode 100644 index 000000000..50ef3e807 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureTypingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureTypingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Type).NotEmpty(); + this.RuleFor(dto => dto.TypedFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs new file mode 100644 index 000000000..8da48f2ca --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Feature metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs new file mode 100644 index 000000000..9be1c930f --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Flow metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FlowValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FlowValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs new file mode 100644 index 000000000..c9ab44bfc --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FramedConcernMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FramedConcernMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs new file mode 100644 index 000000000..24d78eccd --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInteger metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralIntegerValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralIntegerValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs new file mode 100644 index 000000000..373062592 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralRational metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralRationalValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralRationalValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs new file mode 100644 index 000000000..930333510 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Membership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.MemberElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs new file mode 100644 index 000000000..676523692 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Multiplicities; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MultiplicityRange metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MultiplicityRangeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MultiplicityRangeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs new file mode 100644 index 000000000..4bed62238 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the OwningMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class OwningMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public OwningMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs new file mode 100644 index 000000000..bb5502dd9 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceSubsetting metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ReferenceSubsettingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ReferenceSubsettingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.ReferencedFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs new file mode 100644 index 000000000..25eaebdd6 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RequirementUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RequirementUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs new file mode 100644 index 000000000..271a5d853 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SelectExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SelectExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SelectExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Operator).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs new file mode 100644 index 000000000..b5233a05e --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Classifiers; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Subclassification metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SubclassificationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SubclassificationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Subclassifier).NotEmpty(); + this.RuleFor(dto => dto.Superclassifier).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs new file mode 100644 index 000000000..486ab3e4b --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TextualRepresentation metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TextualRepresentationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TextualRepresentationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Body).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Language).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs new file mode 100644 index 000000000..4af648182 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Usage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class UsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public UsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs new file mode 100644 index 000000000..e780af323 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs @@ -0,0 +1,62 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators +{ + using System; + using System.IO; + using System.Threading.Tasks; + + using NUnit.Framework; + + using SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators; + using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; + + [TestFixture] + public class UmlCoreDtoValidatorGeneratorTestFixture + { + private DirectoryInfo outputDirectory; + private UmlCoreDtoValidatorGenerator umlCoreDtoValidatorGenerator; + + [OneTimeSetUp] + public void SetUp() + { + var directoryInfo = new DirectoryInfo(TestContext.CurrentContext.TestDirectory); + + this.outputDirectory = directoryInfo.CreateSubdirectory(Path.Combine("UML", "_SysML2.NET.Validation.Core.DTO")); + this.umlCoreDtoValidatorGenerator = new UmlCoreDtoValidatorGenerator(); + } + + [Test] + public async Task VerifyGenerateAsync() + { + await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateAsync(null, this.outputDirectory), Throws.TypeOf()); + await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, null), Throws.TypeOf()); + + await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, this.outputDirectory), Throws.Nothing); + } + + [Test] + [TestCaseSource(typeof(ExpectedConcreteClasses))] + [Category("Expected")] + public async Task VerifyGenerateDtoValidatorAsync(string className) + { + await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateDtoValidatorAsync(null, this.outputDirectory, className), Throws.TypeOf()); + await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateDtoValidatorAsync(GeneratorSetupFixture.XmiReaderResult, null, className), Throws.TypeOf()); + await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateDtoValidatorAsync(GeneratorSetupFixture.XmiReaderResult, this.outputDirectory, " "), Throws.TypeOf()); + + var generatedCode = await this.umlCoreDtoValidatorGenerator.GenerateDtoValidatorAsync(GeneratorSetupFixture.XmiReaderResult, this.outputDirectory, className); + + var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, + $"Expected/UML/Core/AutoGenDtoValidators/{className}Validator.cs")); + + Assert.That(generatedCode, Is.EqualTo(expected)); + } + } +} diff --git a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs new file mode 100644 index 000000000..40689c49e --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs @@ -0,0 +1,85 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text.RegularExpressions; + + using NUnit.Framework; + + using SysML2.NET.CodeGenerator.Extensions; + using SysML2.NET.CodeGenerator.HandleBarHelpers; + + using uml4net.Extensions; + using uml4net.StructuredClassifiers; + + [TestFixture] + public class DtoValidatorHelperTestFixture + { + private List concreteClasses; + + [OneTimeSetUp] + public void OneTimeSetUp() + { + this.concreteClasses = GeneratorSetupFixture.XmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .Where(x => !x.IsAbstract) + .ToList(); + } + + [Test] + public void VerifyQueryRules() + { + Assert.That(() => DtoValidatorHelper.QueryRules(null), Throws.TypeOf()); + + var membership = this.concreteClasses.Single(x => x.Name == "Membership"); + var owningMembership = this.concreteClasses.Single(x => x.Name == "OwningMembership"); + + using (Assert.EnterMultipleScope()) + { + Assert.That(QueryValidatedPropertyNames(membership), Does.Contain("MemberElement")); + Assert.That(QueryValidatedPropertyNames(owningMembership), Does.Not.Contain("MemberElement")); + Assert.That(QueryValidatedPropertyNames(owningMembership), Does.Not.Contain("OwnedMemberElement")); + } + + var violations = this.concreteClasses + .SelectMany(@class => QueryValidatedPropertyNames(@class) + .Intersect(QueryDerivedPropertyNames(@class)) + .Select(propertyName => $"{@class.Name}.{propertyName}")) + .ToList(); + + Assert.That(violations, Is.Empty); + } + + private static HashSet QueryValidatedPropertyNames(IClass @class) + { + return DtoValidatorHelper.QueryRules(@class) + .Select(rule => Regex.Match(rule, @"dto => dto\.(\w+)").Groups[1].Value) + .ToHashSet(StringComparer.Ordinal); + } + + private static HashSet QueryDerivedPropertyNames(IClass @class) + { + var properties = @class.QueryAllProperties(); + + var nonDerivedNames = properties + .Where(property => !property.IsDerived && !property.IsDerivedUnion) + .Select(property => property.Name.CapitalizeFirstLetter()); + + return properties + .Where(property => property.IsDerived || property.IsDerivedUnion) + .Select(property => property.Name.CapitalizeFirstLetter()) + .Except(nonDerivedNames) + .ToHashSet(StringComparer.Ordinal); + } + } +} diff --git a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGenerator.cs new file mode 100644 index 000000000..47fdcce9b --- /dev/null +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGenerator.cs @@ -0,0 +1,154 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Threading.Tasks; + + using SysML2.NET.CodeGenerator.Extensions; + using SysML2.NET.CodeGenerator.HandleBarHelpers; + + using uml4net.Extensions; + using uml4net.StructuredClassifiers; + using uml4net.xmi.Readers; + + /// + /// UML based handlebars generator for the FluentValidation validators of the core data transfer objects + /// + public class UmlCoreDtoValidatorGenerator : UmlHandleBarsGenerator + { + /// + /// The name of the template that generates a DTO validator + /// + private const string ValidatorTemplateName = "core-dto-validator-uml-template"; + + /// + /// Generates the validators of the concrete classes of the UML model + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// an awaitable + /// + public override Task GenerateAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(outputDirectory); + + return this.GenerateInternalAsync(xmiReaderResult, outputDirectory); + } + + /// + /// Generates the validator of the specified class + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// The name of the class to generate the validator for + /// + /// + /// The generated code + /// + public Task GenerateDtoValidatorAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory, string name) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(outputDirectory); + ArgumentException.ThrowIfNullOrWhiteSpace(name); + + return this.WriteValidatorAsync(QueryValidatedClasses(xmiReaderResult).Single(x => x.Name == name), outputDirectory); + } + + /// + /// Register the custom helpers + /// + protected override void RegisterHelpers() + { + this.Handlebars.RegisterClassHelper(); + this.Handlebars.RegisterNamedElementHelper(); + this.Handlebars.RegisterDtoValidatorHelper(); + } + + /// + /// Register the code templates + /// + protected override void RegisterTemplates() + { + this.RegisterTemplate(ValidatorTemplateName); + } + + /// + /// Queries the concrete classes that a validator is generated for + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The concrete classes of the UML model + /// + private static IEnumerable QueryValidatedClasses(XmiReaderResult xmiReaderResult) + { + return xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .Where(x => !x.IsAbstract); + } + + /// + /// Generates the validators of the concrete classes of the UML model + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// an awaitable + /// + private async Task GenerateInternalAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + foreach (var @class in QueryValidatedClasses(xmiReaderResult)) + { + await this.WriteValidatorAsync(@class, outputDirectory); + } + } + + /// + /// Applies the validator template to the class and writes the result to disk + /// + /// + /// The to generate the validator for + /// + /// + /// The target + /// + /// + /// The generated code + /// + private async Task WriteValidatorAsync(IClass @class, DirectoryInfo outputDirectory) + { + var generatedCode = this.CodeCleanup(this.Templates[ValidatorTemplateName](@class)); + + await WriteAsync(generatedCode, outputDirectory, $"{@class.Name}Validator.cs"); + + return generatedCode; + } + } +} diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs new file mode 100644 index 000000000..2fdd47e15 --- /dev/null +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.HandleBarHelpers +{ + using System; + using System.Collections.Generic; + using System.Linq; + + using HandlebarsDotNet; + + using SysML2.NET.CodeGenerator.Extensions; + + using uml4net.Classification; + using uml4net.Extensions; + using uml4net.SimpleClassifiers; + using uml4net.StructuredClassifiers; + + /// + /// A handlebars block helper that writes the FluentValidation rules derived from the non-derived properties of an + /// + public static class DtoValidatorHelper + { + /// + /// Registers the + /// + /// + /// The context with which the helper needs to be registered + /// + public static void RegisterDtoValidatorHelper(this IHandlebars handlebars) + { + ArgumentNullException.ThrowIfNull(handlebars); + + handlebars.RegisterHelper("DtoValidator.WriteRules", (writer, _, arguments) => + { + if (arguments.Length != 1) + { + throw new HandlebarsException("{{#DtoValidator.WriteRules}} helper must have exactly one argument"); + } + + var @class = arguments[0] as IClass ?? throw new ArgumentException("supposed to be IClass"); + + foreach (var rule in QueryRules(@class)) + { + writer.WriteSafeString(rule + Environment.NewLine); + } + }); + } + + /// + /// Queries the rule statements derived from every non-derived property of the class that is not redefined in it + /// + /// The that the validator validates. + /// The rule statements, ordered by property name. + public static List QueryRules(IClass @class) + { + ArgumentNullException.ThrowIfNull(@class); + + return @class.QueryAllProperties() + .Where(property => !property.IsDerived && !property.IsDerivedUnion && !property.TryQueryRedefinedByProperty(@class, out _)) + .OrderBy(property => property.Name.CapitalizeFirstLetter(), StringComparer.Ordinal) + .SelectMany(QueryPropertyRules) + .ToList(); + } + + /// + /// Queries the rule statements derived from the multiplicity and the type of one property + /// + /// The non-derived . + /// The rule statements. + private static IEnumerable QueryPropertyRules(IProperty property) + { + var selector = $"dto => dto.{property.Name.CapitalizeFirstLetter()}"; + + return property.QueryIsEnumerable() + ? QueryCollectionRules(property, selector) + : QueryScalarRules(property, selector); + } + + /// + /// Queries the rule statements of a property whose upper bound is greater than one + /// + /// The collection . + /// The lambda that selects the property on the DTO. + /// The rule statements. + private static IEnumerable QueryCollectionRules(IProperty property, string selector) + { + yield return $"this.RuleFor({selector}).NotNull();"; + + if (property.Lower > 0) + { + yield return $"this.RuleFor({selector}).Must(value => value == null || value.Count >= {property.Lower});"; + } + + var upper = property.QueryUpperValue(); + + if (upper != int.MaxValue) + { + yield return $"this.RuleFor({selector}).Must(value => value == null || value.Count <= {upper});"; + } + + if (property.IsUnique) + { + yield return $"this.RuleFor({selector}).Must(value => value == null || value.Distinct().Count() == value.Count);"; + } + + var itemRule = property.Type switch + { + IEnumeration => "IsInEnum()", + IDataType => property.QueryIsString() ? "NotNull()" : null, + _ => "NotEmpty()" + }; + + if (itemRule != null) + { + yield return $"this.RuleForEach({selector}).{itemRule};"; + } + } + + /// + /// Queries the rule statements of a property whose upper bound is one + /// + /// The scalar . + /// The lambda that selects the property on the DTO. + /// The rule statements. + private static IEnumerable QueryScalarRules(IProperty property, string selector) + { + switch (property.Type) + { + case IEnumeration: + yield return $"this.RuleFor({selector}).IsInEnum();"; + break; + case IDataType when property.QueryIsString() && property.Lower > 0: + yield return $"this.RuleFor({selector}).NotNull();"; + break; + case IDataType: + break; + default: + yield return property.QueryIsNullableAndNotString() + ? $"this.RuleFor({selector}).Must(value => !value.HasValue || value.Value != System.Guid.Empty);" + : $"this.RuleFor({selector}).NotEmpty();"; + break; + } + } + } +} diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index e55fdfd51..d0c7bfdd2 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -118,6 +118,9 @@ Always + + Always + Always diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs new file mode 100644 index 000000000..e29c3564c --- /dev/null +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs @@ -0,0 +1,44 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + {{ #Class.WriteEnumerationNameSpaces this}} + using SysML2.NET.Core.DTO.{{ #NamedElement.WriteFullyQualifiedNameSpace this }}; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the {{this.Name}} metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class {{this.Name}}Validator : DtoValidator<{{this.Name}}> + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public {{this.Name}}Validator() + { + {{#DtoValidator.WriteRules this}} + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/FeatureValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/FeatureValidatorTestFixture.cs new file mode 100644 index 000000000..1ed26a897 --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/FeatureValidatorTestFixture.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class FeatureValidatorTestFixture + { + [Test] + public void VerifyValidate() + { + var validator = new FeatureValidator(); + var feature = new Feature { Id = Guid.NewGuid(), ElementId = "the element id" }; + + Assert.That(validator.Validate(feature).IsValid, Is.True); + + feature.Direction = FeatureDirectionKind.Inout; + + Assert.That(validator.Validate(feature).IsValid, Is.True); + + feature.Direction = (FeatureDirectionKind)int.MaxValue; + + Assert.That(validator.Validate(feature).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Direction"])); + } + } +} diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/LiteralStringValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/LiteralStringValidatorTestFixture.cs new file mode 100644 index 000000000..828e3189f --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/LiteralStringValidatorTestFixture.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class LiteralStringValidatorTestFixture + { + [Test] + public void VerifyValidate() + { + var validator = new LiteralStringValidator(); + var literalString = new LiteralString { Id = Guid.NewGuid(), ElementId = "the element id", Value = "the value" }; + + Assert.That(validator.Validate(literalString).IsValid, Is.True); + + literalString.Value = string.Empty; + + Assert.That(validator.Validate(literalString).IsValid, Is.True); + + literalString.Value = null; + + Assert.That(validator.Validate(literalString).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Value"])); + } + } +} diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs new file mode 100644 index 000000000..23c54791a --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs @@ -0,0 +1,81 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class MembershipValidatorTestFixture + { + private static readonly string[] OwnedRelationshipFailure = ["OwnedRelationship"]; + + [Test] + public void VerifyValidate() + { + var validator = new MembershipValidator(); + var relationshipId = Guid.NewGuid(); + var membership = new Membership { Id = Guid.NewGuid(), ElementId = "the element id", MemberElement = Guid.NewGuid() }; + + Assert.That(validator.Validate(membership).IsValid, Is.True); + + membership.MemberElement = Guid.Empty; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["MemberElement"])); + + membership.MemberElement = Guid.NewGuid(); + membership.ElementId = null; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["ElementId"])); + + membership.ElementId = string.Empty; + membership.OwningRelationship = Guid.NewGuid(); + + Assert.That(validator.Validate(membership).IsValid, Is.True); + + membership.OwningRelationship = Guid.Empty; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwningRelationship"])); + + membership.OwningRelationship = null; + membership.OwnedRelationship = [relationshipId, relationshipId]; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(OwnedRelationshipFailure)); + + membership.OwnedRelationship = [Guid.Empty]; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelationship[0]"])); + + membership.OwnedRelationship = null; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(OwnedRelationshipFailure)); + + membership.OwnedRelationship = [relationshipId]; + membership.AliasIds = [null]; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["AliasIds[0]"])); + + membership.AliasIds = ["the alias", "the alias"]; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["AliasIds"])); + + membership.AliasIds = ["the alias"]; + membership.Visibility = (VisibilityKind)int.MaxValue; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Visibility"])); + } + } +} diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs new file mode 100644 index 000000000..248c29c8a --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs @@ -0,0 +1,37 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class RequirementConstraintMembershipValidatorTestFixture + { + [Test] + public void VerifyValidate() + { + var validator = new RequirementConstraintMembershipValidator(); + var membership = new RequirementConstraintMembership { Id = Guid.NewGuid(), ElementId = "the element id", Kind = RequirementConstraintKind.Requirement }; + + Assert.That(validator.Validate(membership).IsValid, Is.True); + + membership.Kind = (RequirementConstraintKind)int.MaxValue; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Kind"])); + } + } +} diff --git a/SysML2.NET.Validation.Tests/Core/DTO/DtoValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/DtoValidatorTestFixture.cs new file mode 100644 index 000000000..271dc92ff --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/DtoValidatorTestFixture.cs @@ -0,0 +1,60 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO +{ + using System; + using System.Linq; + + using FluentValidation; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class DtoValidatorTestFixture + { + [Test] + public void VerifyAddCustomValidation() + { + var comment = new Comment { Id = Guid.NewGuid(), Body = "the body" }; + + Assert.That(new ValidatorWithoutCustomValidation().Validate(comment).IsValid, Is.True); + + var validator = new ValidatorWithCustomValidation(); + + Assert.That(validator.Validate(comment).IsValid, Is.True); + + comment.Body = " "; + + Assert.That(validator.Validate(comment).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo([nameof(Comment.Body)])); + Assert.That(new ValidatorWithoutCustomValidation().Validate(comment).IsValid, Is.True); + + comment.Id = Guid.Empty; + + Assert.That(new ValidatorWithoutCustomValidation().Validate(comment).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo([nameof(Comment.Id)])); + } + + private sealed class ValidatorWithoutCustomValidation : DtoValidator + { + } + + private sealed class ValidatorWithCustomValidation : DtoValidator + { + protected override void AddCustomValidation() + { + base.AddCustomValidation(); + + this.RuleFor(dto => dto.Body).Must(value => !string.IsNullOrWhiteSpace(value)); + } + } + } +} diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs new file mode 100644 index 000000000..7bf064a00 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AcceptActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AcceptActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AcceptActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs new file mode 100644 index 000000000..be4b606de --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ActionDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ActionDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ActionDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs new file mode 100644 index 000000000..142b52ee4 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs new file mode 100644 index 000000000..70455634c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ActorMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ActorMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ActorMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs new file mode 100644 index 000000000..fad601e86 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Allocations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AllocationDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AllocationDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AllocationDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs new file mode 100644 index 000000000..05b95b31f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Allocations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AllocationUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AllocationUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AllocationUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs new file mode 100644 index 000000000..de05d2c50 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.AnalysisCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AnalysisCaseDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AnalysisCaseDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AnalysisCaseDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs new file mode 100644 index 000000000..1e8de2749 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.AnalysisCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AnalysisCaseUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AnalysisCaseUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AnalysisCaseUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs new file mode 100644 index 000000000..4d66e4678 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AnnotatingElementValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AnnotatingElementValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs new file mode 100644 index 000000000..bffd0cd11 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Annotation metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AnnotationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AnnotationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AnnotatedElement).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs new file mode 100644 index 000000000..aa8da51d9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Constraints; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AssertConstraintUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AssertConstraintUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AssertConstraintUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs new file mode 100644 index 000000000..9e0be0a01 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AssignmentActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AssignmentActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AssignmentActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs new file mode 100644 index 000000000..f2289cbab --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Associations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AssociationStructure metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AssociationStructureValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AssociationStructureValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs new file mode 100644 index 000000000..5c85533a5 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Associations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Association metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AssociationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AssociationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs new file mode 100644 index 000000000..8aea95fd3 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Attributes; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AttributeDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AttributeDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AttributeDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs new file mode 100644 index 000000000..69b1d486e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Attributes; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the AttributeUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class AttributeUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public AttributeUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs new file mode 100644 index 000000000..cda67a22d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Behaviors; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Behavior metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class BehaviorValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public BehaviorValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs new file mode 100644 index 000000000..547693d21 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Connections; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the BindingConnectorAsUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class BindingConnectorAsUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public BindingConnectorAsUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs new file mode 100644 index 000000000..eb0fa008f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the BindingConnector metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class BindingConnectorValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public BindingConnectorValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs new file mode 100644 index 000000000..fe5bc174a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the BooleanExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class BooleanExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public BooleanExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs new file mode 100644 index 000000000..34781fd88 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Calculations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the CalculationDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CalculationDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CalculationDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs new file mode 100644 index 000000000..8e3c1f744 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Calculations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the CalculationUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CalculationUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CalculationUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs new file mode 100644 index 000000000..93f30da59 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Cases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the CaseDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CaseDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CaseDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs new file mode 100644 index 000000000..9caf1312a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Cases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the CaseUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CaseUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CaseUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs new file mode 100644 index 000000000..96f3004f0 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Classes; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Class metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ClassValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ClassValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs new file mode 100644 index 000000000..1b2ef4a7b --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Classifiers; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Classifier metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ClassifierValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ClassifierValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs new file mode 100644 index 000000000..567c965ec --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the CollectExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CollectExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CollectExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Operator).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs new file mode 100644 index 000000000..1b80b95d0 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Comment metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CommentValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CommentValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Body).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs new file mode 100644 index 000000000..9d6ef2dd9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConcernDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConcernDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConcernDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs new file mode 100644 index 000000000..e686d52a7 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConcernUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConcernUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConcernUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs new file mode 100644 index 000000000..6e42e788f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Ports; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConjugatedPortDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConjugatedPortDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConjugatedPortDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs new file mode 100644 index 000000000..41dc2837c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Ports; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConjugatedPortTyping metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConjugatedPortTypingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConjugatedPortTypingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ConjugatedPortDefinition).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.TypedFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs new file mode 100644 index 000000000..d319b3b33 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Conjugation metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConjugationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConjugationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ConjugatedType).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OriginalType).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs new file mode 100644 index 000000000..e258d505f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Connections; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConnectionDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConnectionDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConnectionDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs new file mode 100644 index 000000000..8869031a9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Connections; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConnectionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConnectionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConnectionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs new file mode 100644 index 000000000..39afea7ce --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Connector metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConnectorValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConnectorValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs new file mode 100644 index 000000000..e5621b151 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Constraints; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConstraintDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConstraintDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConstraintDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs new file mode 100644 index 000000000..348f1b2ae --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Constraints; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConstraintUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConstraintUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConstraintUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs new file mode 100644 index 000000000..cc5962ed1 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ConstructorExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ConstructorExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ConstructorExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs new file mode 100644 index 000000000..2a3a2e340 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the CrossSubsetting metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class CrossSubsettingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public CrossSubsettingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.CrossedFeature).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs new file mode 100644 index 000000000..abb299e62 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.DataTypes; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the DataType metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DataTypeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DataTypeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs new file mode 100644 index 000000000..c3c36a3e6 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the DecisionNode metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DecisionNodeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DecisionNodeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs new file mode 100644 index 000000000..d4824aac2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Definition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs new file mode 100644 index 000000000..5ca9ea19c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs @@ -0,0 +1,62 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Dependencies; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Dependency metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DependencyValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DependencyValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Client).NotNull(); + this.RuleFor(dto => dto.Client).Must(value => value == null || value.Count >= 1); + this.RuleFor(dto => dto.Client).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.Client).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Supplier).NotNull(); + this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Count >= 1); + this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.Supplier).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs new file mode 100644 index 000000000..401ca1a10 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Differencing metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DifferencingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DifferencingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.DifferencingType).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs new file mode 100644 index 000000000..03025697e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Disjoining metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DisjoiningValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DisjoiningValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.DisjoiningType).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.TypeDisjoined).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs new file mode 100644 index 000000000..78113cb14 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Documentation metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class DocumentationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public DocumentationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Body).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs new file mode 100644 index 000000000..0e3f174d2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Packages; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ElementFilterMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ElementFilterMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ElementFilterMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs new file mode 100644 index 000000000..544a926b0 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the EndFeatureMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class EndFeatureMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public EndFeatureMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs new file mode 100644 index 000000000..5d5599816 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Enumerations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class EnumerationDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public EnumerationDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs new file mode 100644 index 000000000..79d94150a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Enumerations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class EnumerationUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public EnumerationUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs new file mode 100644 index 000000000..822fff732 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Occurrences; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the EventOccurrenceUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class EventOccurrenceUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public EventOccurrenceUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs new file mode 100644 index 000000000..68bf86f52 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.States; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ExhibitStateUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ExhibitStateUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ExhibitStateUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs new file mode 100644 index 000000000..d5c3cd4fd --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Expression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs new file mode 100644 index 000000000..fc5f60944 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureChainExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureChainExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureChainExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Operator).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs new file mode 100644 index 000000000..8e0eb1641 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureChaining metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureChainingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureChainingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ChainingFeature).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs new file mode 100644 index 000000000..b49b52f30 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureInverting metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureInvertingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureInvertingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.FeatureInverted).NotEmpty(); + this.RuleFor(dto => dto.InvertingFeature).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs new file mode 100644 index 000000000..d00d178d7 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs new file mode 100644 index 000000000..de8924b36 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureReferenceExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureReferenceExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureReferenceExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs new file mode 100644 index 000000000..50ef3e807 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureTypingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureTypingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Type).NotEmpty(); + this.RuleFor(dto => dto.TypedFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs new file mode 100644 index 000000000..8da48f2ca --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Feature metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs new file mode 100644 index 000000000..5c258b2cc --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.FeatureValues; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureValue metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FeatureValueValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FeatureValueValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs new file mode 100644 index 000000000..0737edfcf --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Flows; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FlowDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FlowDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FlowDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs new file mode 100644 index 000000000..3a805305f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FlowEnd metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FlowEndValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FlowEndValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs new file mode 100644 index 000000000..3e4e0754e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Flows; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FlowUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FlowUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FlowUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs new file mode 100644 index 000000000..9be1c930f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Flow metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FlowValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FlowValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs new file mode 100644 index 000000000..f0052a269 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ForLoopActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ForLoopActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ForLoopActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs new file mode 100644 index 000000000..8eff8fe10 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ForkNode metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ForkNodeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ForkNodeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs new file mode 100644 index 000000000..c9ab44bfc --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FramedConcernMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FramedConcernMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs new file mode 100644 index 000000000..7bdc07190 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Function metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class FunctionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public FunctionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs new file mode 100644 index 000000000..539876344 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the IfActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class IfActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public IfActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs new file mode 100644 index 000000000..0a04a815a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.UseCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the IncludeUseCaseUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class IncludeUseCaseUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public IncludeUseCaseUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs new file mode 100644 index 000000000..ef7c3030d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the IndexExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class IndexExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public IndexExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Operator).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs new file mode 100644 index 000000000..8c59f9c36 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Interactions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Interaction metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class InteractionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public InteractionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs new file mode 100644 index 000000000..7876a8fab --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Interfaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the InterfaceDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class InterfaceDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public InterfaceDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs new file mode 100644 index 000000000..db10068b9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Interfaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the InterfaceUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class InterfaceUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public InterfaceUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs new file mode 100644 index 000000000..217e27f8a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Intersecting metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class IntersectingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public IntersectingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.IntersectingType).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs new file mode 100644 index 000000000..706ee961c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Invariant metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class InvariantValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public InvariantValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs new file mode 100644 index 000000000..66b8ecd0d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the InvocationExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class InvocationExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public InvocationExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs new file mode 100644 index 000000000..507c59d8c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Items; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ItemDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ItemDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ItemDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs new file mode 100644 index 000000000..34fc33de0 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Items; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ItemUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ItemUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ItemUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs new file mode 100644 index 000000000..ec99f2b7a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the JoinNode metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class JoinNodeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public JoinNodeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs new file mode 100644 index 000000000..7365e182d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Packages; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LibraryPackage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LibraryPackageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LibraryPackageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs new file mode 100644 index 000000000..331278842 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralBoolean metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralBooleanValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralBooleanValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs new file mode 100644 index 000000000..fb470fdf4 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs new file mode 100644 index 000000000..eb226b7fb --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInfinity metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralInfinityValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralInfinityValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs new file mode 100644 index 000000000..24d78eccd --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInteger metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralIntegerValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralIntegerValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs new file mode 100644 index 000000000..373062592 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralRational metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralRationalValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralRationalValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs new file mode 100644 index 000000000..75efb7ee2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralString metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class LiteralStringValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public LiteralStringValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Value).NotNull(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs new file mode 100644 index 000000000..187715a23 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MembershipExpose metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MembershipExposeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MembershipExposeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.ImportedMembership).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs new file mode 100644 index 000000000..9b2f63b5e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MembershipImport metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MembershipImportValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MembershipImportValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.ImportedMembership).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs new file mode 100644 index 000000000..930333510 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Membership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.MemberElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs new file mode 100644 index 000000000..5d3482710 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MergeNode metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MergeNodeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MergeNodeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs new file mode 100644 index 000000000..d5384df3d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Metadata; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Metaclass metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MetaclassValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MetaclassValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs new file mode 100644 index 000000000..ce65c1654 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataAccessExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MetadataAccessExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MetadataAccessExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs new file mode 100644 index 000000000..a3fa0a2b6 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Metadata; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MetadataDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MetadataDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs new file mode 100644 index 000000000..a12e7160d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Metadata; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataFeature metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MetadataFeatureValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MetadataFeatureValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs new file mode 100644 index 000000000..e516f679a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Metadata; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MetadataUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MetadataUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs new file mode 100644 index 000000000..676523692 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Multiplicities; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the MultiplicityRange metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MultiplicityRangeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MultiplicityRangeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs new file mode 100644 index 000000000..8c4f1c72e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Multiplicity metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class MultiplicityValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public MultiplicityValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs new file mode 100644 index 000000000..0c799b174 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the NamespaceExpose metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class NamespaceExposeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public NamespaceExposeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.ImportedNamespace).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs new file mode 100644 index 000000000..319a784f2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the NamespaceImport metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class NamespaceImportValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public NamespaceImportValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.ImportedNamespace).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs new file mode 100644 index 000000000..053823d37 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Namespace metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class NamespaceValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public NamespaceValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs new file mode 100644 index 000000000..570e012a2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the NullExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class NullExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public NullExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs new file mode 100644 index 000000000..bb9690977 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Cases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ObjectiveMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ObjectiveMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ObjectiveMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs new file mode 100644 index 000000000..3dd3261ec --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Occurrences; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the OccurrenceDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class OccurrenceDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public OccurrenceDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs new file mode 100644 index 000000000..14d7f821f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Occurrences; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the OccurrenceUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class OccurrenceUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public OccurrenceUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs new file mode 100644 index 000000000..bbce949f8 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the OperatorExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class OperatorExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public OperatorExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Operator).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs new file mode 100644 index 000000000..4bed62238 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the OwningMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class OwningMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public OwningMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs new file mode 100644 index 000000000..4e2967cdc --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Packages; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Package metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PackageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PackageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs new file mode 100644 index 000000000..6783e9fc0 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Behaviors; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ParameterMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ParameterMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ParameterMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs new file mode 100644 index 000000000..9b89dee1c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Parts; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PartDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PartDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PartDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs new file mode 100644 index 000000000..58b3891d9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Parts; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PartUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PartUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PartUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs new file mode 100644 index 000000000..9c9e7d8cb --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PayloadFeature metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PayloadFeatureValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PayloadFeatureValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs new file mode 100644 index 000000000..7c6c415db --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PerformActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PerformActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PerformActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs new file mode 100644 index 000000000..89fcce156 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Ports; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PortConjugation metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PortConjugationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PortConjugationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ConjugatedType).NotEmpty(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OriginalPortDefinition).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs new file mode 100644 index 000000000..e5e8b1deb --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Ports; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PortDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PortDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PortDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs new file mode 100644 index 000000000..6cee5b8c3 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Ports; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the PortUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PortUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PortUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs new file mode 100644 index 000000000..5448b133f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Predicate metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class PredicateValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public PredicateValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs new file mode 100644 index 000000000..4418f3bb9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Redefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RedefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RedefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.RedefinedFeature).NotEmpty(); + this.RuleFor(dto => dto.RedefiningFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs new file mode 100644 index 000000000..bb5502dd9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceSubsetting metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ReferenceSubsettingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ReferenceSubsettingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.ReferencedFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs new file mode 100644 index 000000000..e7bc2bb15 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ReferenceUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ReferenceUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs new file mode 100644 index 000000000..e3263fa64 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RenderingDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RenderingDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RenderingDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs new file mode 100644 index 000000000..0259a6089 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RenderingUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RenderingUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RenderingUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs new file mode 100644 index 000000000..2eacd46bd --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementConstraintMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RequirementConstraintMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RequirementConstraintMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs new file mode 100644 index 000000000..d57663a38 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RequirementDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RequirementDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs new file mode 100644 index 000000000..25eaebdd6 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RequirementUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RequirementUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs new file mode 100644 index 000000000..639c37d7a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.VerificationCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementVerificationMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class RequirementVerificationMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public RequirementVerificationMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs new file mode 100644 index 000000000..576552dc9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ResultExpressionMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ResultExpressionMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ResultExpressionMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs new file mode 100644 index 000000000..986eed0c9 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Functions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ReturnParameterMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ReturnParameterMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ReturnParameterMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs new file mode 100644 index 000000000..c654a6537 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SatisfyRequirementUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SatisfyRequirementUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SatisfyRequirementUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs new file mode 100644 index 000000000..271a5d853 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SelectExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SelectExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SelectExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Operator).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs new file mode 100644 index 000000000..bed5ae0fd --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SendActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SendActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SendActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs new file mode 100644 index 000000000..70c270300 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Specialization metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SpecializationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SpecializationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.General).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Specific).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs new file mode 100644 index 000000000..b7ba54410 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the StakeholderMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class StakeholderMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public StakeholderMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs new file mode 100644 index 000000000..55ee94c7f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.States; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the StateDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class StateDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public StateDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs new file mode 100644 index 000000000..49d5286cd --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.States; + using SysML2.NET.Core.DTO.Systems.States; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the StateSubactionMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class StateSubactionMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public StateSubactionMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs new file mode 100644 index 000000000..9b8064d82 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.States; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the StateUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class StateUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public StateUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs new file mode 100644 index 000000000..ae98f7ddd --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Behaviors; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Step metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class StepValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public StepValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs new file mode 100644 index 000000000..b52dace5f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Kernel.Structures; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Structure metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class StructureValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public StructureValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs new file mode 100644 index 000000000..b5233a05e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Classifiers; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Subclassification metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SubclassificationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SubclassificationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Subclassifier).NotEmpty(); + this.RuleFor(dto => dto.Superclassifier).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs new file mode 100644 index 000000000..4b8febca3 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Requirements; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SubjectMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SubjectMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SubjectMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs new file mode 100644 index 000000000..85ad28ab7 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Subsetting metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SubsettingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SubsettingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.SubsettedFeature).NotEmpty(); + this.RuleFor(dto => dto.SubsettingFeature).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs new file mode 100644 index 000000000..5a0733eca --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Connections; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionAsUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SuccessionAsUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SuccessionAsUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs new file mode 100644 index 000000000..f2881291b --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Flows; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionFlowUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SuccessionFlowUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SuccessionFlowUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs new file mode 100644 index 000000000..e42d4d448 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionFlow metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SuccessionFlowValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SuccessionFlowValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs new file mode 100644 index 000000000..7c86cec75 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Succession metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class SuccessionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public SuccessionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs new file mode 100644 index 000000000..ed279f3b2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TerminateActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TerminateActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TerminateActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs new file mode 100644 index 000000000..486ab3e4b --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Annotations; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TextualRepresentation metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TextualRepresentationValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TextualRepresentationValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Body).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Language).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs new file mode 100644 index 000000000..e0162510a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.States; + using SysML2.NET.Core.DTO.Systems.States; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TransitionFeatureMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TransitionFeatureMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TransitionFeatureMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs new file mode 100644 index 000000000..41dbdbf6b --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.States; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TransitionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TransitionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TransitionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs new file mode 100644 index 000000000..565ab0db6 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Actions; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TriggerInvocationExpression metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TriggerInvocationExpressionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TriggerInvocationExpressionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.Kind).IsInEnum(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs new file mode 100644 index 000000000..31443c83f --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Features; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the TypeFeaturing metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TypeFeaturingValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TypeFeaturingValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.FeatureOfType).NotEmpty(); + this.RuleFor(dto => dto.FeaturingType).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs new file mode 100644 index 000000000..f0aa3aff2 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Type metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class TypeValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public TypeValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs new file mode 100644 index 000000000..3690dc43a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Core.Types; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Unioning metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class UnioningValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public UnioningValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.UnioningType).NotEmpty(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs new file mode 100644 index 000000000..4af648182 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the Usage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class UsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public UsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs new file mode 100644 index 000000000..3e196cd97 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.UseCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the UseCaseDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class UseCaseDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public UseCaseDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs new file mode 100644 index 000000000..96bd051a3 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.UseCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the UseCaseUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class UseCaseUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public UseCaseUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs new file mode 100644 index 000000000..542d2241b --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the VariantMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class VariantMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public VariantMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs new file mode 100644 index 000000000..3fd84b14d --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.VerificationCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the VerificationCaseDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class VerificationCaseDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public VerificationCaseDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs new file mode 100644 index 000000000..2674346cc --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.VerificationCases; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the VerificationCaseUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class VerificationCaseUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public VerificationCaseUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs new file mode 100644 index 000000000..8b7cf075e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ViewDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ViewDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ViewDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs new file mode 100644 index 000000000..242085e6e --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ViewRenderingMembership metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ViewRenderingMembershipValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ViewRenderingMembershipValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); + this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.Visibility).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs new file mode 100644 index 000000000..1c882c13c --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ViewUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ViewUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ViewUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs new file mode 100644 index 000000000..c530ba7f7 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ViewpointDefinition metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ViewpointDefinitionValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ViewpointDefinitionValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs new file mode 100644 index 000000000..c7826d64a --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Views; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the ViewpointUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class ViewpointUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public ViewpointUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs new file mode 100644 index 000000000..7d832a6e8 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using System.CodeDom.Compiler; + using System.Linq; + + using FluentValidation; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + + /// + /// Validates a against the multiplicities and types of the non-derived properties of the WhileLoopActionUsage metaclass + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed partial class WhileLoopActionUsageValidator : DtoValidator + { + /// + /// Initializes a new instance of the class + /// and registers its generated rules + /// + public WhileLoopActionUsageValidator() + { + this.RuleFor(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.AliasIds).NotNull(); + this.RuleFor(dto => dto.Direction).IsInEnum(); + this.RuleFor(dto => dto.ElementId).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).NotNull(); + this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); + this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); + this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.PortionKind).IsInEnum(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Validation/Core/DTO/DtoValidator.cs b/SysML2.NET.Validation/Core/DTO/DtoValidator.cs new file mode 100644 index 000000000..73a2fb552 --- /dev/null +++ b/SysML2.NET.Validation/Core/DTO/DtoValidator.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Core.DTO +{ + using FluentValidation; + + using SysML2.NET.Core.DTO.Root.Elements; + + /// + /// Base class of the validators that check a core data transfer object against the multiplicities and types of its metaclass + /// + /// + /// The type that is validated + /// + public abstract class DtoValidator : AbstractValidator where TElement : IElement + { + /// + /// Initializes a new instance of the class, registers the identifier rule and the hand-coded rules + /// + protected DtoValidator() + { + this.RuleFor(dto => dto.Id).NotEmpty(); + this.RegisterCustomValidation(); + } + + /// + /// Registers the hand-coded rules that complement the rules derived from the UML model + /// + /// + /// The base constructor invokes this method once, before the derived constructor registers the generated rules. + /// + protected virtual void AddCustomValidation() + { + } + + /// + /// Invokes from the constructor through a non-virtual call site + /// + private void RegisterCustomValidation() + { + this.AddCustomValidation(); + } + } +} diff --git a/SysML2.NET.Validation/SysML2.NET.Validation.csproj b/SysML2.NET.Validation/SysML2.NET.Validation.csproj index ba971f967..0579e0fa2 100644 --- a/SysML2.NET.Validation/SysML2.NET.Validation.csproj +++ b/SysML2.NET.Validation/SysML2.NET.Validation.csproj @@ -4,7 +4,7 @@ net10.0 14.0 0.26.0 - A .NET implementation of the OMG SysML v2 REST/HTTP PSM request validators + A .NET implementation of the OMG SysML v2 Core DTO and REST/HTTP PSM request validators SysML2.NET.Validation Starion Group S.A. Copyright © Starion Group S.A. diff --git a/SysML2.NET/PIM/DTO/Project.cs b/SysML2.NET/PIM/DTO/Project.cs index bae4e67ed..655c2c4f2 100644 --- a/SysML2.NET/PIM/DTO/Project.cs +++ b/SysML2.NET/PIM/DTO/Project.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------------ // // // Copyright (C) 2022-2026 Starion Group S.A. From a7499f3f97f728f23cb9fde7b74cfc694768c865 Mon Sep 17 00:00:00 2001 From: Zeynep Delal Mutlu Date: Mon, 16 Nov 2026 11:58:09 +0100 Subject: [PATCH 2/5] regex check --- .../HandleBarHelpers/DtoValidatorHelperTestFixture.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs index 40689c49e..34720dac5 100644 --- a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs @@ -23,7 +23,7 @@ namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators using uml4net.StructuredClassifiers; [TestFixture] - public class DtoValidatorHelperTestFixture + public partial class DtoValidatorHelperTestFixture { private List concreteClasses; @@ -63,7 +63,7 @@ public void VerifyQueryRules() private static HashSet QueryValidatedPropertyNames(IClass @class) { return DtoValidatorHelper.QueryRules(@class) - .Select(rule => Regex.Match(rule, @"dto => dto\.(\w+)").Groups[1].Value) + .Select(rule => RuleSelectorRegex().Match(rule).Groups[1].Value) .ToHashSet(StringComparer.Ordinal); } @@ -81,5 +81,8 @@ private static HashSet QueryDerivedPropertyNames(IClass @class) .Except(nonDerivedNames) .ToHashSet(StringComparer.Ordinal); } + + [GeneratedRegex(@"dto => dto\.(\w+)")] + private static partial Regex RuleSelectorRegex(); } } From 30fc45524ce01b17251637120df7dd0fd87e753e Mon Sep 17 00:00:00 2001 From: Zeynep Delal Mutlu Date: Mon, 16 Nov 2026 16:11:45 +0100 Subject: [PATCH 3/5] PR review --- .../DtoValidatorHelperTestFixture.cs | 3 + .../HandleBarHelpers/DtoValidatorHelper.cs | 134 ++++++++++++++---- .../Uml/core-dto-validator-uml-template.hbs | 1 - .../MembershipValidatorTestFixture.cs | 32 +---- .../OwningMembershipValidatorTestFixture.cs | 40 ++++++ 5 files changed, 156 insertions(+), 54 deletions(-) create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs diff --git a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs index 34720dac5..8e928ec7d 100644 --- a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs @@ -49,6 +49,9 @@ public void VerifyQueryRules() Assert.That(QueryValidatedPropertyNames(membership), Does.Contain("MemberElement")); Assert.That(QueryValidatedPropertyNames(owningMembership), Does.Not.Contain("MemberElement")); Assert.That(QueryValidatedPropertyNames(owningMembership), Does.Not.Contain("OwnedMemberElement")); + Assert.That(QueryValidatedPropertyNames(membership), Does.Not.Contain("OwnedRelatedElement")); + Assert.That(QueryValidatedPropertyNames(membership), Does.Not.Contain("OwningRelatedElement")); + Assert.That(DtoValidatorHelper.QueryRules(owningMembership), Does.Contain("this.RuleFor(dto => dto.OwnedRelatedElement).Cascade(CascadeMode.Stop).NotEmpty();")); } var violations = this.concreteClasses diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs index 2fdd47e15..a5fee6b48 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs @@ -62,24 +62,97 @@ public static List QueryRules(IClass @class) { ArgumentNullException.ThrowIfNull(@class); - return @class.QueryAllProperties() - .Where(property => !property.IsDerived && !property.IsDerivedUnion && !property.TryQueryRedefinedByProperty(@class, out _)) + var properties = @class.QueryAllProperties() + .Where(property => !property.TryQueryRedefinedByProperty(@class, out _)) + .ToList(); + + var requiredDerivedProperties = properties + .Where(property => (property.IsDerived || property.IsDerivedUnion) && property.Lower > 0) + .Select(property => (property.Lower, SupersetIds: QuerySupersetIds(property))) + .ToList(); + + return properties + .Where(property => !property.IsDerived && !property.IsDerivedUnion) .OrderBy(property => property.Name.CapitalizeFirstLetter(), StringComparer.Ordinal) - .SelectMany(QueryPropertyRules) + .SelectMany(property => QueryPropertyRules(property, QueryEffectiveLower(property, requiredDerivedProperties))) .ToList(); } + /// + /// Queries the lower bound of a non-derived property, raised by every required derived property that subsets or redefines it + /// + /// The non-derived . + /// The lower bound and the superset ids of each required derived property of the class. + /// The effective lower bound. + private static int QueryEffectiveLower(IProperty property, List<(int Lower, HashSet SupersetIds)> requiredDerivedProperties) + { + var redefinitionChainIds = QueryRedefinitionChainIds(property); + + return requiredDerivedProperties + .Where(derived => derived.SupersetIds.Overlaps(redefinitionChainIds)) + .Select(derived => derived.Lower) + .Append(property.Lower) + .Max(); + } + + /// + /// Queries the ids of the property and of every property it transitively subsets or redefines + /// + /// The to start from. + /// The ids of the property and its supersets. + private static HashSet QuerySupersetIds(IProperty property) + { + var visited = new HashSet { property.XmiId }; + var queue = new Queue([property]); + + while (queue.Count > 0) + { + var current = queue.Dequeue(); + + foreach (var superset in current.RedefinedProperty.Concat(current.SubsettedProperty).Where(superset => visited.Add(superset.XmiId))) + { + queue.Enqueue(superset); + } + } + + return visited; + } + + /// + /// Queries the ids of the property and of every property it transitively redefines + /// + /// The to start from. + /// The ids of the property and of the properties it redefines. + private static HashSet QueryRedefinitionChainIds(IProperty property) + { + var visited = new HashSet { property.XmiId }; + var queue = new Queue([property]); + + while (queue.Count > 0) + { + var current = queue.Dequeue(); + + foreach (var redefined in current.RedefinedProperty.Where(redefined => visited.Add(redefined.XmiId))) + { + queue.Enqueue(redefined); + } + } + + return visited; + } + /// /// Queries the rule statements derived from the multiplicity and the type of one property /// /// The non-derived . + /// The effective lower bound applied when the property is a collection. /// The rule statements. - private static IEnumerable QueryPropertyRules(IProperty property) + private static IEnumerable QueryPropertyRules(IProperty property, int collectionLower) { var selector = $"dto => dto.{property.Name.CapitalizeFirstLetter()}"; return property.QueryIsEnumerable() - ? QueryCollectionRules(property, selector) + ? QueryCollectionRules(property, collectionLower, selector) : QueryScalarRules(property, selector); } @@ -87,40 +160,47 @@ private static IEnumerable QueryPropertyRules(IProperty property) /// Queries the rule statements of a property whose upper bound is greater than one /// /// The collection . + /// The effective lower bound of the property. /// The lambda that selects the property on the DTO. /// The rule statements. - private static IEnumerable QueryCollectionRules(IProperty property, string selector) + private static IEnumerable QueryCollectionRules(IProperty property, int lower, string selector) { - yield return $"this.RuleFor({selector}).NotNull();"; + var countRule = QueryCollectionCountRule(lower, property.QueryUpperValue()); - if (property.Lower > 0) + if (countRule != null) { - yield return $"this.RuleFor({selector}).Must(value => value == null || value.Count >= {property.Lower});"; + yield return $"this.RuleFor({selector}){countRule};"; } + } - var upper = property.QueryUpperValue(); + /// + /// Queries the single rule chain that enforces the lower and upper bounds of a collection + /// + /// The lower bound of the collection. + /// The upper bound of the collection, when unbounded. + /// The rule chain appended to RuleFor, or null when the bounds demand nothing. + private static string QueryCollectionCountRule(int lower, int upper) + { + var isBounded = upper != int.MaxValue; - if (upper != int.MaxValue) + if (lower == 0) { - yield return $"this.RuleFor({selector}).Must(value => value == null || value.Count <= {upper});"; + return isBounded ? $".Must(value => value == null || value.Count <= {upper})" : null; } - if (property.IsUnique) - { - yield return $"this.RuleFor({selector}).Must(value => value == null || value.Distinct().Count() == value.Count);"; - } + var chain = ".Cascade(CascadeMode.Stop).NotEmpty()"; - var itemRule = property.Type switch + if (lower > 1) { - IEnumeration => "IsInEnum()", - IDataType => property.QueryIsString() ? "NotNull()" : null, - _ => "NotEmpty()" - }; + chain += $".Must(value => value.Count >= {lower})"; + } - if (itemRule != null) + if (isBounded) { - yield return $"this.RuleForEach({selector}).{itemRule};"; + chain += $".Must(value => value.Count <= {upper})"; } + + return chain; } /// @@ -142,9 +222,11 @@ private static IEnumerable QueryScalarRules(IProperty property, string s case IDataType: break; default: - yield return property.QueryIsNullableAndNotString() - ? $"this.RuleFor({selector}).Must(value => !value.HasValue || value.Value != System.Guid.Empty);" - : $"this.RuleFor({selector}).NotEmpty();"; + if (property.Lower > 0) + { + yield return $"this.RuleFor({selector}).NotEmpty();"; + } + break; } } diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs index e29c3564c..805739b44 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs index 23c54791a..049e45973 100644 --- a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs @@ -21,8 +21,6 @@ namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator [TestFixture] public class MembershipValidatorTestFixture { - private static readonly string[] OwnedRelationshipFailure = ["OwnedRelationship"]; - [Test] public void VerifyValidate() { @@ -42,37 +40,17 @@ public void VerifyValidate() Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["ElementId"])); membership.ElementId = string.Empty; - membership.OwningRelationship = Guid.NewGuid(); - - Assert.That(validator.Validate(membership).IsValid, Is.True); - membership.OwningRelationship = Guid.Empty; + membership.OwnedRelationship = [relationshipId, relationshipId, Guid.Empty]; + membership.AliasIds = [null, null]; - Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwningRelationship"])); - - membership.OwningRelationship = null; - membership.OwnedRelationship = [relationshipId, relationshipId]; - - Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(OwnedRelationshipFailure)); - - membership.OwnedRelationship = [Guid.Empty]; - - Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelationship[0]"])); + Assert.That(validator.Validate(membership).IsValid, Is.True); membership.OwnedRelationship = null; + membership.AliasIds = null; - Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(OwnedRelationshipFailure)); - - membership.OwnedRelationship = [relationshipId]; - membership.AliasIds = [null]; - - Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["AliasIds[0]"])); - - membership.AliasIds = ["the alias", "the alias"]; - - Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["AliasIds"])); + Assert.That(validator.Validate(membership).IsValid, Is.True); - membership.AliasIds = ["the alias"]; membership.Visibility = (VisibilityKind)int.MaxValue; Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Visibility"])); diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs new file mode 100644 index 000000000..d5ff348e1 --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class OwningMembershipValidatorTestFixture + { + [Test] + public void VerifyValidate() + { + var validator = new OwningMembershipValidator(); + var owningMembership = new OwningMembership { Id = Guid.NewGuid(), ElementId = "the element id", OwnedRelatedElement = [Guid.NewGuid()] }; + + Assert.That(validator.Validate(owningMembership).IsValid, Is.True); + + owningMembership.OwnedRelatedElement = []; + + Assert.That(validator.Validate(owningMembership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelatedElement"])); + + owningMembership.OwnedRelatedElement = null; + + Assert.That(validator.Validate(owningMembership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelatedElement"])); + } + } +} From 4752eb362606b0eaa76abd170e46f1ad6d5741f8 Mon Sep 17 00:00:00 2001 From: Zeynep Delal Mutlu Date: Tue, 17 Nov 2026 17:14:05 +0100 Subject: [PATCH 4/5] validator code regeneration. --- .../AnnotatingElementValidator.cs | 11 +- .../AssociationValidator.cs | 15 +- .../DependencyValidator.cs | 25 +-- .../EnumerationDefinitionValidator.cs | 11 +- .../FeatureTypingValidator.cs | 15 +- .../AutoGenDtoValidators/FeatureValidator.cs | 11 +- .../AutoGenDtoValidators/FlowValidator.cs | 15 +- .../FramedConcernMembershipValidator.cs | 17 +- .../LiteralIntegerValidator.cs | 11 +- .../LiteralRationalValidator.cs | 11 +- .../MembershipValidator.cs | 16 +- .../MultiplicityRangeValidator.cs | 11 +- .../OwningMembershipValidator.cs | 17 +- .../ReferenceSubsettingValidator.cs | 16 +- .../RequirementUsageValidator.cs | 11 +- .../SelectExpressionValidator.cs | 11 +- .../SubclassificationValidator.cs | 15 +- .../TextualRepresentationValidator.cs | 11 +- .../AutoGenDtoValidators/UsageValidator.cs | 11 +- ...UmlCoreDtoValidatorGeneratorTestFixture.cs | 17 ++ .../DtoValidatorHelperTestFixture.cs | 100 ++++++++- .../HandleBarHelpers/DtoValidatorHelper.cs | 195 ++++++++---------- .../Properties/AssemblyInfo.cs | 2 + .../Uml/core-dto-validator-uml-template.hbs | 3 +- ...gatedPortDefinitionValidatorTestFixture.cs | 40 ++++ .../DependencyValidatorTestFixture.cs | 45 ++++ .../MembershipValidatorTestFixture.cs | 8 +- .../OwningMembershipValidatorTestFixture.cs | 8 +- ...onstraintMembershipValidatorTestFixture.cs | 11 +- .../AcceptActionUsageValidator.cs | 11 +- .../ActionDefinitionValidator.cs | 11 +- .../AutoGenValidator/ActionUsageValidator.cs | 11 +- .../ActorMembershipValidator.cs | 17 +- .../AllocationDefinitionValidator.cs | 15 +- .../AllocationUsageValidator.cs | 15 +- .../AnalysisCaseDefinitionValidator.cs | 11 +- .../AnalysisCaseUsageValidator.cs | 11 +- .../AnnotatingElementValidator.cs | 11 +- .../AutoGenValidator/AnnotationValidator.cs | 15 +- .../AssertConstraintUsageValidator.cs | 11 +- .../AssignmentActionUsageValidator.cs | 11 +- .../AssociationStructureValidator.cs | 15 +- .../AutoGenValidator/AssociationValidator.cs | 15 +- .../AttributeDefinitionValidator.cs | 11 +- .../AttributeUsageValidator.cs | 11 +- .../DTO/AutoGenValidator/BehaviorValidator.cs | 11 +- .../BindingConnectorAsUsageValidator.cs | 15 +- .../BindingConnectorValidator.cs | 15 +- .../BooleanExpressionValidator.cs | 11 +- .../CalculationDefinitionValidator.cs | 11 +- .../CalculationUsageValidator.cs | 11 +- .../CaseDefinitionValidator.cs | 11 +- .../AutoGenValidator/CaseUsageValidator.cs | 11 +- .../DTO/AutoGenValidator/ClassValidator.cs | 11 +- .../AutoGenValidator/ClassifierValidator.cs | 11 +- .../CollectExpressionValidator.cs | 11 +- .../DTO/AutoGenValidator/CommentValidator.cs | 11 +- .../ConcernDefinitionValidator.cs | 11 +- .../AutoGenValidator/ConcernUsageValidator.cs | 11 +- .../ConjugatedPortDefinitionValidator.cs | 12 +- .../ConjugatedPortTypingValidator.cs | 15 +- .../AutoGenValidator/ConjugationValidator.cs | 15 +- .../ConnectionDefinitionValidator.cs | 15 +- .../ConnectionUsageValidator.cs | 15 +- .../AutoGenValidator/ConnectorValidator.cs | 15 +- .../ConstraintDefinitionValidator.cs | 11 +- .../ConstraintUsageValidator.cs | 11 +- .../ConstructorExpressionValidator.cs | 11 +- .../CrossSubsettingValidator.cs | 16 +- .../DTO/AutoGenValidator/DataTypeValidator.cs | 11 +- .../AutoGenValidator/DecisionNodeValidator.cs | 11 +- .../AutoGenValidator/DefinitionValidator.cs | 11 +- .../AutoGenValidator/DependencyValidator.cs | 25 +-- .../AutoGenValidator/DifferencingValidator.cs | 16 +- .../AutoGenValidator/DisjoiningValidator.cs | 15 +- .../DocumentationValidator.cs | 11 +- .../ElementFilterMembershipValidator.cs | 17 +- .../EndFeatureMembershipValidator.cs | 17 +- .../EnumerationDefinitionValidator.cs | 11 +- .../EnumerationUsageValidator.cs | 11 +- .../EventOccurrenceUsageValidator.cs | 11 +- .../ExhibitStateUsageValidator.cs | 11 +- .../AutoGenValidator/ExpressionValidator.cs | 11 +- .../FeatureChainExpressionValidator.cs | 11 +- .../FeatureChainingValidator.cs | 16 +- .../FeatureInvertingValidator.cs | 15 +- .../FeatureMembershipValidator.cs | 17 +- .../FeatureReferenceExpressionValidator.cs | 11 +- .../FeatureTypingValidator.cs | 15 +- .../DTO/AutoGenValidator/FeatureValidator.cs | 11 +- .../AutoGenValidator/FeatureValueValidator.cs | 17 +- .../FlowDefinitionValidator.cs | 15 +- .../DTO/AutoGenValidator/FlowEndValidator.cs | 11 +- .../AutoGenValidator/FlowUsageValidator.cs | 15 +- .../DTO/AutoGenValidator/FlowValidator.cs | 15 +- .../ForLoopActionUsageValidator.cs | 11 +- .../DTO/AutoGenValidator/ForkNodeValidator.cs | 11 +- .../FramedConcernMembershipValidator.cs | 17 +- .../DTO/AutoGenValidator/FunctionValidator.cs | 11 +- .../IfActionUsageValidator.cs | 11 +- .../IncludeUseCaseUsageValidator.cs | 11 +- .../IndexExpressionValidator.cs | 11 +- .../AutoGenValidator/InteractionValidator.cs | 15 +- .../InterfaceDefinitionValidator.cs | 15 +- .../InterfaceUsageValidator.cs | 15 +- .../AutoGenValidator/IntersectingValidator.cs | 16 +- .../AutoGenValidator/InvariantValidator.cs | 11 +- .../InvocationExpressionValidator.cs | 11 +- .../ItemDefinitionValidator.cs | 11 +- .../AutoGenValidator/ItemUsageValidator.cs | 11 +- .../DTO/AutoGenValidator/JoinNodeValidator.cs | 11 +- .../LibraryPackageValidator.cs | 11 +- .../LiteralBooleanValidator.cs | 11 +- .../LiteralExpressionValidator.cs | 11 +- .../LiteralInfinityValidator.cs | 11 +- .../LiteralIntegerValidator.cs | 11 +- .../LiteralRationalValidator.cs | 11 +- .../LiteralStringValidator.cs | 11 +- .../MembershipExposeValidator.cs | 16 +- .../MembershipImportValidator.cs | 16 +- .../AutoGenValidator/MembershipValidator.cs | 16 +- .../AutoGenValidator/MergeNodeValidator.cs | 11 +- .../AutoGenValidator/MetaclassValidator.cs | 11 +- .../MetadataAccessExpressionValidator.cs | 11 +- .../MetadataDefinitionValidator.cs | 11 +- .../MetadataFeatureValidator.cs | 11 +- .../MetadataUsageValidator.cs | 11 +- .../MultiplicityRangeValidator.cs | 11 +- .../AutoGenValidator/MultiplicityValidator.cs | 11 +- .../NamespaceExposeValidator.cs | 16 +- .../NamespaceImportValidator.cs | 16 +- .../AutoGenValidator/NamespaceValidator.cs | 11 +- .../NullExpressionValidator.cs | 11 +- .../ObjectiveMembershipValidator.cs | 17 +- .../OccurrenceDefinitionValidator.cs | 11 +- .../OccurrenceUsageValidator.cs | 11 +- .../OperatorExpressionValidator.cs | 11 +- .../OwningMembershipValidator.cs | 17 +- .../DTO/AutoGenValidator/PackageValidator.cs | 11 +- .../ParameterMembershipValidator.cs | 17 +- .../PartDefinitionValidator.cs | 11 +- .../AutoGenValidator/PartUsageValidator.cs | 11 +- .../PayloadFeatureValidator.cs | 11 +- .../PerformActionUsageValidator.cs | 11 +- .../PortConjugationValidator.cs | 16 +- .../PortDefinitionValidator.cs | 11 +- .../AutoGenValidator/PortUsageValidator.cs | 11 +- .../AutoGenValidator/PredicateValidator.cs | 11 +- .../AutoGenValidator/RedefinitionValidator.cs | 15 +- .../ReferenceSubsettingValidator.cs | 16 +- .../ReferenceUsageValidator.cs | 11 +- .../RenderingDefinitionValidator.cs | 11 +- .../RenderingUsageValidator.cs | 11 +- ...equirementConstraintMembershipValidator.cs | 17 +- .../RequirementDefinitionValidator.cs | 11 +- .../RequirementUsageValidator.cs | 11 +- ...uirementVerificationMembershipValidator.cs | 17 +- .../ResultExpressionMembershipValidator.cs | 17 +- .../ReturnParameterMembershipValidator.cs | 17 +- .../SatisfyRequirementUsageValidator.cs | 11 +- .../SelectExpressionValidator.cs | 11 +- .../SendActionUsageValidator.cs | 11 +- .../SpecializationValidator.cs | 15 +- .../StakeholderMembershipValidator.cs | 17 +- .../StateDefinitionValidator.cs | 11 +- .../StateSubactionMembershipValidator.cs | 17 +- .../AutoGenValidator/StateUsageValidator.cs | 11 +- .../DTO/AutoGenValidator/StepValidator.cs | 11 +- .../AutoGenValidator/StructureValidator.cs | 11 +- .../SubclassificationValidator.cs | 15 +- .../SubjectMembershipValidator.cs | 17 +- .../AutoGenValidator/SubsettingValidator.cs | 15 +- .../SuccessionAsUsageValidator.cs | 15 +- .../SuccessionFlowUsageValidator.cs | 15 +- .../SuccessionFlowValidator.cs | 15 +- .../AutoGenValidator/SuccessionValidator.cs | 15 +- .../TerminateActionUsageValidator.cs | 11 +- .../TextualRepresentationValidator.cs | 11 +- .../TransitionFeatureMembershipValidator.cs | 17 +- .../TransitionUsageValidator.cs | 11 +- .../TriggerInvocationExpressionValidator.cs | 11 +- .../TypeFeaturingValidator.cs | 15 +- .../DTO/AutoGenValidator/TypeValidator.cs | 11 +- .../DTO/AutoGenValidator/UnioningValidator.cs | 16 +- .../DTO/AutoGenValidator/UsageValidator.cs | 11 +- .../UseCaseDefinitionValidator.cs | 11 +- .../AutoGenValidator/UseCaseUsageValidator.cs | 11 +- .../VariantMembershipValidator.cs | 17 +- .../VerificationCaseDefinitionValidator.cs | 11 +- .../VerificationCaseUsageValidator.cs | 11 +- .../ViewDefinitionValidator.cs | 11 +- .../ViewRenderingMembershipValidator.cs | 17 +- .../AutoGenValidator/ViewUsageValidator.cs | 11 +- .../ViewpointDefinitionValidator.cs | 11 +- .../ViewpointUsageValidator.cs | 11 +- .../WhileLoopActionUsageValidator.cs | 11 +- SysML2.NET/PIM/DTO/Project.cs | 2 +- 197 files changed, 742 insertions(+), 2096 deletions(-) create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidatorTestFixture.cs create mode 100644 SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/DependencyValidatorTestFixture.cs diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs index 4d66e4678..6281ba9a9 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AnnotatingElementValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AnnotatingElementValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class AnnotatingElementValidator : DtoValidator public AnnotatingElementValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs index 5c85533a5..dd31844e2 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/AssociationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Associations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Association metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Association metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AssociationValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class AssociationValidator : DtoValidator /// public AssociationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs index 5ca9ea19c..a0d6ae790 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/DependencyValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Dependencies; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Dependency metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Dependency metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DependencyValidator : DtoValidator @@ -33,26 +33,9 @@ public sealed partial class DependencyValidator : DtoValidator /// public DependencyValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.Client).NotNull(); - this.RuleFor(dto => dto.Client).Must(value => value == null || value.Count >= 1); - this.RuleFor(dto => dto.Client).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.Client).NotEmpty(); + this.RuleFor(dto => dto.Client).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.Supplier).NotNull(); - this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Count >= 1); - this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.Supplier).NotEmpty(); + this.RuleFor(dto => dto.Supplier).NotEmpty(); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs index 5d5599816..8451c380c 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/EnumerationDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Enumerations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class EnumerationDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class EnumerationDefinitionValidator : DtoValidator public EnumerationDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs index 50ef3e807..265e15087 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureTypingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureTypingValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class FeatureTypingValidator : DtoValidator /// public FeatureTypingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.Type).NotEmpty(); this.RuleFor(dto => dto.TypedFeature).NotEmpty(); } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs index 8da48f2ca..bf29f693a 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FeatureValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Feature metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Feature metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class FeatureValidator : DtoValidator /// public FeatureValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs index 9be1c930f..e675925ef 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FlowValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Interactions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Flow metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Flow metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FlowValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class FlowValidator : DtoValidator /// public FlowValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs index c9ab44bfc..f41cfd6b9 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/FramedConcernMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FramedConcernMembershipValidator : DtoValidator @@ -35,19 +35,10 @@ public sealed partial class FramedConcernMembershipValidator : DtoValidator public FramedConcernMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs index 24d78eccd..3b1031fe3 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralIntegerValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInteger metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInteger metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralIntegerValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralIntegerValidator : DtoValidator public LiteralIntegerValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs index 373062592..fdfcbf134 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/LiteralRationalValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralRational metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralRational metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralRationalValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralRationalValidator : DtoValidator public LiteralRationalValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs index 930333510..f6dce33e5 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Membership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Membership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MembershipValidator : DtoValidator @@ -34,19 +34,9 @@ public sealed partial class MembershipValidator : DtoValidator /// public MembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.MemberElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs index 676523692..4b2ebaf62 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/MultiplicityRangeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Multiplicities; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MultiplicityRange metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MultiplicityRange metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MultiplicityRangeValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class MultiplicityRangeValidator : DtoValidator public MultiplicityRangeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs index 4bed62238..b6fc18797 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/OwningMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the OwningMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the OwningMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class OwningMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class OwningMembershipValidator : DtoValidator public OwningMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs index bb5502dd9..37e72fb2f 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/ReferenceSubsettingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceSubsetting metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceSubsetting metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ReferenceSubsettingValidator : DtoValidator @@ -33,18 +33,8 @@ public sealed partial class ReferenceSubsettingValidator : DtoValidator public ReferenceSubsettingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.ReferencedFeature).NotEmpty(); } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs index 25eaebdd6..f15c9d6f5 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/RequirementUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RequirementUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RequirementUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class RequirementUsageValidator : DtoValidator public RequirementUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs index 271a5d853..26ccf3cd8 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SelectExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SelectExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SelectExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SelectExpressionValidator : DtoValidator @@ -34,16 +34,9 @@ public sealed partial class SelectExpressionValidator : DtoValidator public SelectExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Operator).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs index b5233a05e..c8afee987 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/SubclassificationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Classifiers; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Subclassification metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Subclassification metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SubclassificationValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class SubclassificationValidator : DtoValidator public SubclassificationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.Subclassifier).NotEmpty(); this.RuleFor(dto => dto.Superclassifier).NotEmpty(); } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs index 486ab3e4b..7fe701395 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/TextualRepresentationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TextualRepresentation metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TextualRepresentation metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TextualRepresentationValidator : DtoValidator @@ -33,16 +33,9 @@ public sealed partial class TextualRepresentationValidator : DtoValidator public TextualRepresentationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Body).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Language).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs index 4af648182..ba8753393 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoValidators/UsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Usage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Usage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class UsageValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class UsageValidator : DtoValidator /// public UsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs index e780af323..dea85d87e 100644 --- a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoValidatorGeneratorTestFixture.cs @@ -11,13 +11,17 @@ namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators { using System; using System.IO; + using System.Linq; using System.Threading.Tasks; using NUnit.Framework; + using SysML2.NET.CodeGenerator.Extensions; using SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators; using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; + using uml4net.StructuredClassifiers; + [TestFixture] public class UmlCoreDtoValidatorGeneratorTestFixture { @@ -40,6 +44,19 @@ public async Task VerifyGenerateAsync() await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, null), Throws.TypeOf()); await Assert.ThatAsync(() => this.umlCoreDtoValidatorGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, this.outputDirectory), Throws.Nothing); + + var expectedFileNames = GeneratorSetupFixture.XmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(package => package.PackagedElement.OfType()) + .Where(@class => !@class.IsAbstract) + .Select(@class => $"{@class.Name}Validator.cs"); + + var generatedFileNames = this.outputDirectory.GetFiles("*Validator.cs").Select(file => file.Name).ToList(); + + using (Assert.EnterMultipleScope()) + { + Assert.That(generatedFileNames, Is.EquivalentTo(expectedFileNames)); + Assert.That(generatedFileNames, Does.Not.Contain("ElementValidator.cs")); + } } [Test] diff --git a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs index 8e928ec7d..67413f324 100644 --- a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs @@ -14,6 +14,8 @@ namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators using System.Linq; using System.Text.RegularExpressions; + using HandlebarsDotNet; + using NUnit.Framework; using SysML2.NET.CodeGenerator.Extensions; @@ -36,37 +38,112 @@ public void OneTimeSetUp() .ToList(); } + [Test] + public void VerifyQueryCollectionCountRule() + { + using (Assert.EnterMultipleScope()) + { + Assert.That(DtoValidatorHelper.QueryCollectionCountRule(0, int.MaxValue), Is.Null); + Assert.That(DtoValidatorHelper.QueryCollectionCountRule(0, 3), Is.EqualTo(".Must(value => value == null || value.Count <= 3)")); + Assert.That(DtoValidatorHelper.QueryCollectionCountRule(1, int.MaxValue), Is.EqualTo(".NotEmpty()")); + Assert.That(DtoValidatorHelper.QueryCollectionCountRule(2, int.MaxValue), Is.EqualTo(".Cascade(CascadeMode.Stop).NotEmpty().Must(value => value.Count >= 2)")); + Assert.That(DtoValidatorHelper.QueryCollectionCountRule(1, 3), Is.EqualTo(".Cascade(CascadeMode.Stop).NotEmpty().Must(value => value.Count <= 3)")); + Assert.That(DtoValidatorHelper.QueryCollectionCountRule(2, 5), Is.EqualTo(".Cascade(CascadeMode.Stop).NotEmpty().Must(value => value.Count >= 2).Must(value => value.Count <= 5)")); + } + } + [Test] public void VerifyQueryRules() { Assert.That(() => DtoValidatorHelper.QueryRules(null), Throws.TypeOf()); - var membership = this.concreteClasses.Single(x => x.Name == "Membership"); - var owningMembership = this.concreteClasses.Single(x => x.Name == "OwningMembership"); + var membership = this.QueryClass("Membership"); + var owningMembership = this.QueryClass("OwningMembership"); + var feature = this.QueryClass("Feature"); + + List membershipRules = + [ + "this.RuleFor(dto => dto.ElementId).NotNull();", + "this.RuleFor(dto => dto.MemberElement).NotEmpty();", + "this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty();", + "this.RuleFor(dto => dto.Visibility).IsInEnum();" + ]; using (Assert.EnterMultipleScope()) { - Assert.That(QueryValidatedPropertyNames(membership), Does.Contain("MemberElement")); + Assert.That(DtoValidatorHelper.QueryRules(membership), Is.EqualTo(membershipRules)); + Assert.That(QueryValidatedPropertyNames(owningMembership), Does.Not.Contain("MemberElement")); Assert.That(QueryValidatedPropertyNames(owningMembership), Does.Not.Contain("OwnedMemberElement")); - Assert.That(QueryValidatedPropertyNames(membership), Does.Not.Contain("OwnedRelatedElement")); - Assert.That(QueryValidatedPropertyNames(membership), Does.Not.Contain("OwningRelatedElement")); - Assert.That(DtoValidatorHelper.QueryRules(owningMembership), Does.Contain("this.RuleFor(dto => dto.OwnedRelatedElement).Cascade(CascadeMode.Stop).NotEmpty();")); + Assert.That(DtoValidatorHelper.QueryRules(owningMembership), Does.Contain("this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty();")); + Assert.That(DtoValidatorHelper.QueryRules(this.QueryClass("FeatureMembership")), Does.Contain("this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty();")); + Assert.That(DtoValidatorHelper.QueryRules(this.QueryClass("ConjugatedPortDefinition")), Does.Contain("this.RuleFor(dto => dto.OwnedRelationship).NotEmpty();")); + + Assert.That(QueryValidatedPropertyNames(this.QueryClass("PortDefinition")), Does.Not.Contain("OwnedRelationship")); + Assert.That(QueryValidatedPropertyNames(feature), Does.Not.Contain("OwnedRelationship")); + Assert.That(QueryValidatedPropertyNames(this.QueryClass("Dependency")), Does.Not.Contain("OwnedRelatedElement")); + + Assert.That(QueryValidatedPropertyNames(feature), Does.Not.Contain("IsComposite")); + Assert.That(QueryValidatedPropertyNames(feature), Does.Not.Contain("DeclaredName")); + Assert.That(QueryValidatedPropertyNames(this.QueryClass("LiteralInteger")), Does.Not.Contain("Value")); } - var violations = this.concreteClasses + var rulesByClass = this.concreteClasses + .Select(@class => (@class.Name, Rules: DtoValidatorHelper.QueryRules(@class))) + .ToList(); + + var derivedViolations = this.concreteClasses .SelectMany(@class => QueryValidatedPropertyNames(@class) .Intersect(QueryDerivedPropertyNames(@class)) .Select(propertyName => $"{@class.Name}.{propertyName}")) .ToList(); - Assert.That(violations, Is.Empty); + var forbiddenRules = rulesByClass + .SelectMany(entry => entry.Rules) + .Where(rule => rule.Contains("RuleForEach") || rule.Contains("Distinct()") || rule.Contains("HasValue")) + .ToList(); + + var classesWithRepeatedProperty = rulesByClass + .Where(entry => entry.Rules.Select(QuerySelectedPropertyName).Distinct().Count() != entry.Rules.Count) + .Select(entry => entry.Name) + .ToList(); + + using (Assert.EnterMultipleScope()) + { + Assert.That(derivedViolations, Is.Empty); + Assert.That(forbiddenRules, Is.Empty); + Assert.That(classesWithRepeatedProperty, Is.Empty); + } + } + + [Test] + public void VerifyRegisterDtoValidatorHelper() + { + Assert.That(() => ((IHandlebars)null).RegisterDtoValidatorHelper(), Throws.TypeOf()); + + var handlebars = Handlebars.CreateSharedEnvironment(); + handlebars.RegisterDtoValidatorHelper(); + + var template = handlebars.Compile("{{DtoValidator.WriteRules this}}"); + + using (Assert.EnterMultipleScope()) + { + Assert.That(template(this.QueryClass("Membership")), Does.Contain("this.RuleFor(dto => dto.MemberElement).NotEmpty();")); + Assert.That(template(this.QueryClass("Membership")), Does.Contain("=>")); + Assert.That(() => template(new { }), Throws.TypeOf()); + Assert.That(() => handlebars.Compile("{{DtoValidator.WriteRules}}")(new { }), Throws.TypeOf()); + } + } + + private static string QuerySelectedPropertyName(string rule) + { + return RuleSelectorRegex().Match(rule).Groups[1].Value; } private static HashSet QueryValidatedPropertyNames(IClass @class) { return DtoValidatorHelper.QueryRules(@class) - .Select(rule => RuleSelectorRegex().Match(rule).Groups[1].Value) + .Select(QuerySelectedPropertyName) .ToHashSet(StringComparer.Ordinal); } @@ -87,5 +164,10 @@ private static HashSet QueryDerivedPropertyNames(IClass @class) [GeneratedRegex(@"dto => dto\.(\w+)")] private static partial Regex RuleSelectorRegex(); + + private IClass QueryClass(string name) + { + return this.concreteClasses.Single(x => x.Name == name); + } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs index a5fee6b48..2b651b0c4 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/DtoValidatorHelper.cs @@ -27,32 +27,6 @@ namespace SysML2.NET.CodeGenerator.HandleBarHelpers /// public static class DtoValidatorHelper { - /// - /// Registers the - /// - /// - /// The context with which the helper needs to be registered - /// - public static void RegisterDtoValidatorHelper(this IHandlebars handlebars) - { - ArgumentNullException.ThrowIfNull(handlebars); - - handlebars.RegisterHelper("DtoValidator.WriteRules", (writer, _, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#DtoValidator.WriteRules}} helper must have exactly one argument"); - } - - var @class = arguments[0] as IClass ?? throw new ArgumentException("supposed to be IClass"); - - foreach (var rule in QueryRules(@class)) - { - writer.WriteSafeString(rule + Environment.NewLine); - } - }); - } - /// /// Queries the rule statements derived from every non-derived property of the class that is not redefined in it /// @@ -68,7 +42,7 @@ public static List QueryRules(IClass @class) var requiredDerivedProperties = properties .Where(property => (property.IsDerived || property.IsDerivedUnion) && property.Lower > 0) - .Select(property => (property.Lower, SupersetIds: QuerySupersetIds(property))) + .Select(property => (property.Lower, SupersetIds: QueryTransitiveIds(property, current => current.RedefinedProperty.Concat(current.SubsettedProperty)))) .ToList(); return properties @@ -79,81 +53,61 @@ public static List QueryRules(IClass @class) } /// - /// Queries the lower bound of a non-derived property, raised by every required derived property that subsets or redefines it - /// - /// The non-derived . - /// The lower bound and the superset ids of each required derived property of the class. - /// The effective lower bound. - private static int QueryEffectiveLower(IProperty property, List<(int Lower, HashSet SupersetIds)> requiredDerivedProperties) - { - var redefinitionChainIds = QueryRedefinitionChainIds(property); - - return requiredDerivedProperties - .Where(derived => derived.SupersetIds.Overlaps(redefinitionChainIds)) - .Select(derived => derived.Lower) - .Append(property.Lower) - .Max(); - } - - /// - /// Queries the ids of the property and of every property it transitively subsets or redefines + /// Registers the /// - /// The to start from. - /// The ids of the property and its supersets. - private static HashSet QuerySupersetIds(IProperty property) + /// + /// The context with which the helper needs to be registered + /// + public static void RegisterDtoValidatorHelper(this IHandlebars handlebars) { - var visited = new HashSet { property.XmiId }; - var queue = new Queue([property]); + ArgumentNullException.ThrowIfNull(handlebars); - while (queue.Count > 0) + handlebars.RegisterHelper("DtoValidator.WriteRules", (writer, _, arguments) => { - var current = queue.Dequeue(); - - foreach (var superset in current.RedefinedProperty.Concat(current.SubsettedProperty).Where(superset => visited.Add(superset.XmiId))) + if (arguments.Length != 1) { - queue.Enqueue(superset); + throw new HandlebarsException("{{#DtoValidator.WriteRules}} helper must have exactly one argument"); } - } - return visited; + var @class = arguments[0] as IClass ?? throw new ArgumentException("supposed to be IClass"); + + foreach (var rule in QueryRules(@class)) + { + writer.WriteSafeString(rule + Environment.NewLine); + } + }); } /// - /// Queries the ids of the property and of every property it transitively redefines + /// Queries the single rule chain that enforces the lower and upper bounds of a collection /// - /// The to start from. - /// The ids of the property and of the properties it redefines. - private static HashSet QueryRedefinitionChainIds(IProperty property) + /// The lower bound of the collection. + /// The upper bound of the collection, when unbounded. + /// The rule chain appended to RuleFor, or null when the bounds demand nothing. + internal static string QueryCollectionCountRule(int lower, int upper) { - var visited = new HashSet { property.XmiId }; - var queue = new Queue([property]); + var isBounded = upper != int.MaxValue; - while (queue.Count > 0) + if (lower == 0) { - var current = queue.Dequeue(); + return isBounded ? $".Must(value => value == null || value.Count <= {upper})" : null; + } - foreach (var redefined in current.RedefinedProperty.Where(redefined => visited.Add(redefined.XmiId))) - { - queue.Enqueue(redefined); - } + List validators = [".NotEmpty()"]; + + if (lower > 1) + { + validators.Add($".Must(value => value.Count >= {lower})"); } - return visited; - } + if (isBounded) + { + validators.Add($".Must(value => value.Count <= {upper})"); + } - /// - /// Queries the rule statements derived from the multiplicity and the type of one property - /// - /// The non-derived . - /// The effective lower bound applied when the property is a collection. - /// The rule statements. - private static IEnumerable QueryPropertyRules(IProperty property, int collectionLower) - { - var selector = $"dto => dto.{property.Name.CapitalizeFirstLetter()}"; + var chain = string.Concat(validators); - return property.QueryIsEnumerable() - ? QueryCollectionRules(property, collectionLower, selector) - : QueryScalarRules(property, selector); + return validators.Count > 1 ? ".Cascade(CascadeMode.Stop)" + chain : chain; } /// @@ -174,55 +128,58 @@ private static IEnumerable QueryCollectionRules(IProperty property, int } /// - /// Queries the single rule chain that enforces the lower and upper bounds of a collection + /// Queries the lower bound of a non-derived property, raised by every required derived property that subsets or redefines it /// - /// The lower bound of the collection. - /// The upper bound of the collection, when unbounded. - /// The rule chain appended to RuleFor, or null when the bounds demand nothing. - private static string QueryCollectionCountRule(int lower, int upper) + /// The non-derived . + /// The lower bound and the superset ids of each required derived property of the class. + /// The effective lower bound. + private static int QueryEffectiveLower(IProperty property, List<(int Lower, HashSet SupersetIds)> requiredDerivedProperties) { - var isBounded = upper != int.MaxValue; + var redefinitionChainIds = QueryTransitiveIds(property, current => current.RedefinedProperty); - if (lower == 0) - { - return isBounded ? $".Must(value => value == null || value.Count <= {upper})" : null; - } - - var chain = ".Cascade(CascadeMode.Stop).NotEmpty()"; - - if (lower > 1) - { - chain += $".Must(value => value.Count >= {lower})"; - } + return requiredDerivedProperties + .Where(derived => derived.SupersetIds.Overlaps(redefinitionChainIds)) + .Select(derived => derived.Lower) + .Append(property.Lower) + .Max(); + } - if (isBounded) - { - chain += $".Must(value => value.Count <= {upper})"; - } + /// + /// Queries the rule statements derived from the multiplicity and the type of one property + /// + /// The non-derived . + /// The effective lower bound of the property. + /// The rule statements. + private static IEnumerable QueryPropertyRules(IProperty property, int lower) + { + var selector = $"dto => dto.{property.Name.CapitalizeFirstLetter()}"; - return chain; + return property.QueryIsEnumerable() + ? QueryCollectionRules(property, lower, selector) + : QueryScalarRules(property, lower, selector); } /// /// Queries the rule statements of a property whose upper bound is one /// /// The scalar . + /// The effective lower bound of the property. /// The lambda that selects the property on the DTO. /// The rule statements. - private static IEnumerable QueryScalarRules(IProperty property, string selector) + private static IEnumerable QueryScalarRules(IProperty property, int lower, string selector) { switch (property.Type) { case IEnumeration: yield return $"this.RuleFor({selector}).IsInEnum();"; break; - case IDataType when property.QueryIsString() && property.Lower > 0: + case IDataType when property.QueryIsString() && lower > 0: yield return $"this.RuleFor({selector}).NotNull();"; break; case IDataType: break; default: - if (property.Lower > 0) + if (lower > 0) { yield return $"this.RuleFor({selector}).NotEmpty();"; } @@ -230,5 +187,27 @@ private static IEnumerable QueryScalarRules(IProperty property, string s break; } } + + /// + /// Queries the ids of the property and of every property transitively reached through the given edges + /// + /// The to start from. + /// The edges followed from each visited property. + /// The ids of the property and of every property reached. + private static HashSet QueryTransitiveIds(IProperty property, Func> next) + { + HashSet visited = [property.XmiId]; + var queue = new Queue([property]); + + while (queue.Count > 0) + { + foreach (var reached in next(queue.Dequeue()).Where(reached => visited.Add(reached.XmiId))) + { + queue.Enqueue(reached); + } + } + + return visited; + } } } diff --git a/SysML2.NET.CodeGenerator/Properties/AssemblyInfo.cs b/SysML2.NET.CodeGenerator/Properties/AssemblyInfo.cs index fe319c5d2..eae02206a 100644 --- a/SysML2.NET.CodeGenerator/Properties/AssemblyInfo.cs +++ b/SysML2.NET.CodeGenerator/Properties/AssemblyInfo.cs @@ -8,5 +8,7 @@ // ------------------------------------------------------------------------------------------------ using System; +using System.Runtime.CompilerServices; [assembly: CLSCompliant(false)] +[assembly: InternalsVisibleTo("SysML2.NET.CodeGenerator.Tests")] diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs index 805739b44..ce85b369b 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-validator-uml-template.hbs @@ -22,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.{{ #NamedElement.WriteFullyQualifiedNameSpace this }}; /// - /// Validates a against the multiplicities and types of the non-derived properties of the {{this.Name}} metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the {{this.Name}} metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class {{this.Name}}Validator : DtoValidator<{{this.Name}}> diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidatorTestFixture.cs new file mode 100644 index 000000000..ac52407bf --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidatorTestFixture.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Systems.Ports; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class ConjugatedPortDefinitionValidatorTestFixture + { + [Test] + public void VerifyValidate() + { + var validator = new ConjugatedPortDefinitionValidator(); + var conjugatedPortDefinition = new ConjugatedPortDefinition { Id = Guid.NewGuid(), ElementId = "the element id", OwnedRelationship = [Guid.NewGuid()] }; + + Assert.That(validator.Validate(conjugatedPortDefinition).IsValid, Is.True); + + conjugatedPortDefinition.OwnedRelationship = []; + + Assert.That(validator.Validate(conjugatedPortDefinition).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelationship"])); + + conjugatedPortDefinition.OwnedRelationship = null; + + Assert.That(validator.Validate(conjugatedPortDefinition).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelationship"])); + } + } +} diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/DependencyValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/DependencyValidatorTestFixture.cs new file mode 100644 index 000000000..f7c3993ce --- /dev/null +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/DependencyValidatorTestFixture.cs @@ -0,0 +1,45 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Validation.Tests.Core.DTO.AutoGenValidator +{ + using System; + using System.Linq; + + using NUnit.Framework; + + using SysML2.NET.Core.DTO.Root.Dependencies; + using SysML2.NET.Validation.Core.DTO; + + [TestFixture] + public class DependencyValidatorTestFixture + { + [Test] + public void VerifyValidate() + { + var validator = new DependencyValidator(); + var dependency = new Dependency { Id = Guid.NewGuid(), ElementId = "the element id", Client = [Guid.NewGuid()], Supplier = [Guid.NewGuid()] }; + + Assert.That(validator.Validate(dependency).IsValid, Is.True); + + dependency.Client = []; + + Assert.That(validator.Validate(dependency).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Client"])); + + dependency.Supplier = null; + + Assert.That(validator.Validate(dependency).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Client", "Supplier"])); + + dependency.Client = [Guid.NewGuid(), Guid.NewGuid()]; + dependency.Supplier = [Guid.NewGuid()]; + + Assert.That(validator.Validate(dependency).IsValid, Is.True); + } + } +} diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs index 049e45973..8d29a975a 100644 --- a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/MembershipValidatorTestFixture.cs @@ -26,10 +26,16 @@ public void VerifyValidate() { var validator = new MembershipValidator(); var relationshipId = Guid.NewGuid(); - var membership = new Membership { Id = Guid.NewGuid(), ElementId = "the element id", MemberElement = Guid.NewGuid() }; + var membership = new Membership { Id = Guid.NewGuid(), ElementId = "the element id", MemberElement = Guid.NewGuid(), OwningRelatedElement = Guid.NewGuid() }; Assert.That(validator.Validate(membership).IsValid, Is.True); + membership.OwningRelatedElement = null; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwningRelatedElement"])); + + membership.OwningRelatedElement = Guid.NewGuid(); + membership.MemberElement = Guid.Empty; Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["MemberElement"])); diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs index d5ff348e1..6cc41d1fd 100644 --- a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/OwningMembershipValidatorTestFixture.cs @@ -24,10 +24,16 @@ public class OwningMembershipValidatorTestFixture public void VerifyValidate() { var validator = new OwningMembershipValidator(); - var owningMembership = new OwningMembership { Id = Guid.NewGuid(), ElementId = "the element id", OwnedRelatedElement = [Guid.NewGuid()] }; + var owningMembership = new OwningMembership { Id = Guid.NewGuid(), ElementId = "the element id", OwnedRelatedElement = [Guid.NewGuid()], OwningRelatedElement = Guid.NewGuid() }; Assert.That(validator.Validate(owningMembership).IsValid, Is.True); + owningMembership.OwningRelatedElement = null; + + Assert.That(validator.Validate(owningMembership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwningRelatedElement"])); + + owningMembership.OwningRelatedElement = Guid.NewGuid(); + owningMembership.OwnedRelatedElement = []; Assert.That(validator.Validate(owningMembership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelatedElement"])); diff --git a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs index 248c29c8a..daf81fc45 100644 --- a/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs +++ b/SysML2.NET.Validation.Tests/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidatorTestFixture.cs @@ -25,10 +25,19 @@ public class RequirementConstraintMembershipValidatorTestFixture public void VerifyValidate() { var validator = new RequirementConstraintMembershipValidator(); - var membership = new RequirementConstraintMembership { Id = Guid.NewGuid(), ElementId = "the element id", Kind = RequirementConstraintKind.Requirement }; + var membership = new RequirementConstraintMembership + { + Id = Guid.NewGuid(), ElementId = "the element id", Kind = RequirementConstraintKind.Requirement, + OwnedRelatedElement = [Guid.NewGuid()], OwningRelatedElement = Guid.NewGuid() + }; Assert.That(validator.Validate(membership).IsValid, Is.True); + membership.OwnedRelatedElement = []; + + Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["OwnedRelatedElement"])); + + membership.OwnedRelatedElement = [Guid.NewGuid()]; membership.Kind = (RequirementConstraintKind)int.MaxValue; Assert.That(validator.Validate(membership).Errors.Select(failure => failure.PropertyName), Is.EquivalentTo(["Kind"])); diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs index 7bf064a00..8a622912a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AcceptActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AcceptActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AcceptActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AcceptActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class AcceptActionUsageValidator : DtoValidator public AcceptActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs index be4b606de..8a8450186 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ActionDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ActionDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ActionDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ActionDefinitionValidator : DtoValidator public ActionDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs index 142b52ee4..eafc48f3f 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ActionUsageValidator : DtoValidator /// public ActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs index 70455634c..85859c292 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ActorMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ActorMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ActorMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ActorMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ActorMembershipValidator : DtoValidator public ActorMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs index fad601e86..5bbcad407 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Allocations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AllocationDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AllocationDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AllocationDefinitionValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class AllocationDefinitionValidator : DtoValidator public AllocationDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs index 05b95b31f..5d930f03b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AllocationUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Allocations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AllocationUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AllocationUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AllocationUsageValidator : DtoValidator @@ -35,19 +35,8 @@ public sealed partial class AllocationUsageValidator : DtoValidator public AllocationUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs index de05d2c50..e3045b19f 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.AnalysisCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AnalysisCaseDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AnalysisCaseDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AnalysisCaseDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class AnalysisCaseDefinitionValidator : DtoValidator public AnalysisCaseDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs index 1e8de2749..dc08f2963 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnalysisCaseUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.AnalysisCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AnalysisCaseUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AnalysisCaseUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AnalysisCaseUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class AnalysisCaseUsageValidator : DtoValidator public AnalysisCaseUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs index 4d66e4678..6281ba9a9 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotatingElementValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AnnotatingElementValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class AnnotatingElementValidator : DtoValidator public AnnotatingElementValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs index bffd0cd11..029f356e5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AnnotationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Annotation metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Annotation metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AnnotationValidator : DtoValidator @@ -33,19 +33,8 @@ public sealed partial class AnnotationValidator : DtoValidator /// public AnnotationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.AnnotatedElement).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs index aa8da51d9..06be1f2e6 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssertConstraintUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Constraints; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AssertConstraintUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AssertConstraintUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AssertConstraintUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class AssertConstraintUsageValidator : DtoValidator public AssertConstraintUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs index 9e0be0a01..aa63ada63 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssignmentActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AssignmentActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AssignmentActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AssignmentActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class AssignmentActionUsageValidator : DtoValidator public AssignmentActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs index f2289cbab..267784d93 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationStructureValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Associations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AssociationStructure metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AssociationStructure metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AssociationStructureValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class AssociationStructureValidator : DtoValidator public AssociationStructureValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs index 5c85533a5..dd31844e2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AssociationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Associations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Association metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Association metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AssociationValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class AssociationValidator : DtoValidator /// public AssociationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs index 8aea95fd3..867e57f7a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Attributes; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AttributeDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AttributeDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AttributeDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class AttributeDefinitionValidator : DtoValidator public AttributeDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs index 69b1d486e..18c664088 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/AttributeUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Attributes; /// - /// Validates a against the multiplicities and types of the non-derived properties of the AttributeUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the AttributeUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class AttributeUsageValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class AttributeUsageValidator : DtoValidator public AttributeUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs index cda67a22d..09fd6b61d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BehaviorValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Behaviors; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Behavior metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Behavior metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class BehaviorValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class BehaviorValidator : DtoValidator /// public BehaviorValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs index 547693d21..293e99e2d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorAsUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Connections; /// - /// Validates a against the multiplicities and types of the non-derived properties of the BindingConnectorAsUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the BindingConnectorAsUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class BindingConnectorAsUsageValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class BindingConnectorAsUsageValidator : DtoValidator public BindingConnectorAsUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs index eb0fa008f..4f2d4b916 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BindingConnectorValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Connectors; /// - /// Validates a against the multiplicities and types of the non-derived properties of the BindingConnector metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the BindingConnector metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class BindingConnectorValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class BindingConnectorValidator : DtoValidator public BindingConnectorValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs index fe5bc174a..97b11653c 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/BooleanExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the BooleanExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the BooleanExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class BooleanExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class BooleanExpressionValidator : DtoValidator public BooleanExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs index 34781fd88..e544af7b5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Calculations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the CalculationDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the CalculationDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CalculationDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class CalculationDefinitionValidator : DtoValidator public CalculationDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs index 8e3c1f744..73f93a3b2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CalculationUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Calculations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the CalculationUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the CalculationUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CalculationUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class CalculationUsageValidator : DtoValidator public CalculationUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs index 93f30da59..48723784d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Cases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the CaseDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the CaseDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CaseDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class CaseDefinitionValidator : DtoValidator public CaseDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs index 9caf1312a..f01951b33 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CaseUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Cases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the CaseUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the CaseUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CaseUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class CaseUsageValidator : DtoValidator /// public CaseUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs index 96f3004f0..bda654955 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Classes; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Class metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Class metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ClassValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ClassValidator : DtoValidator /// public ClassValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs index 1b2ef4a7b..d080b60b5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ClassifierValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Classifiers; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Classifier metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Classifier metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ClassifierValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ClassifierValidator : DtoValidator /// public ClassifierValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs index 567c965ec..e82608712 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CollectExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the CollectExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the CollectExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CollectExpressionValidator : DtoValidator @@ -34,16 +34,9 @@ public sealed partial class CollectExpressionValidator : DtoValidator public CollectExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Operator).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs index 1b80b95d0..cf419035b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CommentValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Comment metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Comment metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CommentValidator : DtoValidator @@ -33,15 +33,8 @@ public sealed partial class CommentValidator : DtoValidator /// public CommentValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Body).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs index 9d6ef2dd9..3e68e17d2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConcernDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConcernDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConcernDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ConcernDefinitionValidator : DtoValidator public ConcernDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs index e686d52a7..d25dbb76f 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConcernUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConcernUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConcernUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConcernUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ConcernUsageValidator : DtoValidator /// public ConcernUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs index 6e42e788f..6c6969a94 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Ports; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConjugatedPortDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConjugatedPortDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConjugatedPortDefinitionValidator : DtoValidator @@ -33,14 +33,8 @@ public sealed partial class ConjugatedPortDefinitionValidator : DtoValidator public ConjugatedPortDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelationship).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs index 41dc2837c..bdb4eb0f2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugatedPortTypingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Ports; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConjugatedPortTyping metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConjugatedPortTyping metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConjugatedPortTypingValidator : DtoValidator @@ -33,19 +33,8 @@ public sealed partial class ConjugatedPortTypingValidator : DtoValidator public ConjugatedPortTypingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ConjugatedPortDefinition).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.TypedFeature).NotEmpty(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs index d319b3b33..8c8cf1eea 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConjugationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Conjugation metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Conjugation metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConjugationValidator : DtoValidator @@ -33,20 +33,9 @@ public sealed partial class ConjugationValidator : DtoValidator /// public ConjugationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ConjugatedType).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.OriginalType).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs index e258d505f..12bcd41d8 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Connections; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConnectionDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConnectionDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConnectionDefinitionValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class ConnectionDefinitionValidator : DtoValidator public ConnectionDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs index 8869031a9..113cd7aac 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Connections; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConnectionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConnectionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConnectionUsageValidator : DtoValidator @@ -35,19 +35,8 @@ public sealed partial class ConnectionUsageValidator : DtoValidator public ConnectionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs index 39afea7ce..48d065545 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConnectorValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Connectors; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Connector metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Connector metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConnectorValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class ConnectorValidator : DtoValidator /// public ConnectorValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs index e5621b151..36ab61660 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Constraints; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConstraintDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConstraintDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConstraintDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ConstraintDefinitionValidator : DtoValidator public ConstraintDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs index 348f1b2ae..ab54788b1 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstraintUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Constraints; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConstraintUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConstraintUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConstraintUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ConstraintUsageValidator : DtoValidator public ConstraintUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs index cc5962ed1..79b46e29d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ConstructorExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ConstructorExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ConstructorExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ConstructorExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class ConstructorExpressionValidator : DtoValidator public ConstructorExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs index 2a3a2e340..4b5e2f707 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/CrossSubsettingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the CrossSubsetting metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the CrossSubsetting metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class CrossSubsettingValidator : DtoValidator @@ -33,19 +33,9 @@ public sealed partial class CrossSubsettingValidator : DtoValidator public CrossSubsettingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.CrossedFeature).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs index abb299e62..fe25811c7 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DataTypeValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.DataTypes; /// - /// Validates a against the multiplicities and types of the non-derived properties of the DataType metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the DataType metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DataTypeValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class DataTypeValidator : DtoValidator /// public DataTypeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs index c3c36a3e6..3accda5ae 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DecisionNodeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the DecisionNode metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the DecisionNode metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DecisionNodeValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class DecisionNodeValidator : DtoValidator /// public DecisionNodeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs index d4824aac2..ed99fbb0a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Definition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Definition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class DefinitionValidator : DtoValidator /// public DefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs index 5ca9ea19c..a0d6ae790 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DependencyValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Dependencies; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Dependency metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Dependency metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DependencyValidator : DtoValidator @@ -33,26 +33,9 @@ public sealed partial class DependencyValidator : DtoValidator /// public DependencyValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.Client).NotNull(); - this.RuleFor(dto => dto.Client).Must(value => value == null || value.Count >= 1); - this.RuleFor(dto => dto.Client).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.Client).NotEmpty(); + this.RuleFor(dto => dto.Client).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.Supplier).NotNull(); - this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Count >= 1); - this.RuleFor(dto => dto.Supplier).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.Supplier).NotEmpty(); + this.RuleFor(dto => dto.Supplier).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs index 401ca1a10..f91cad6f7 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DifferencingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Differencing metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Differencing metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DifferencingValidator : DtoValidator @@ -33,19 +33,9 @@ public sealed partial class DifferencingValidator : DtoValidator /// public DifferencingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.DifferencingType).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs index 03025697e..63d04ee61 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DisjoiningValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Disjoining metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Disjoining metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DisjoiningValidator : DtoValidator @@ -33,19 +33,8 @@ public sealed partial class DisjoiningValidator : DtoValidator /// public DisjoiningValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.DisjoiningType).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.TypeDisjoined).NotEmpty(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs index 78113cb14..a85429fa2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/DocumentationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Documentation metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Documentation metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class DocumentationValidator : DtoValidator @@ -33,15 +33,8 @@ public sealed partial class DocumentationValidator : DtoValidator /// public DocumentationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Body).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs index 0e3f174d2..95365b6fb 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ElementFilterMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Packages; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ElementFilterMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ElementFilterMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ElementFilterMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ElementFilterMembershipValidator : DtoValidator public ElementFilterMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs index 544a926b0..8f137d0ee 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EndFeatureMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the EndFeatureMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the EndFeatureMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class EndFeatureMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class EndFeatureMembershipValidator : DtoValidator public EndFeatureMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs index 5d5599816..8451c380c 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Enumerations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class EnumerationDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class EnumerationDefinitionValidator : DtoValidator public EnumerationDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs index 79d94150a..08bcb0ddf 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EnumerationUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Enumerations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the EnumerationUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class EnumerationUsageValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class EnumerationUsageValidator : DtoValidator public EnumerationUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs index 822fff732..ece35769e 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/EventOccurrenceUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Occurrences; /// - /// Validates a against the multiplicities and types of the non-derived properties of the EventOccurrenceUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the EventOccurrenceUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class EventOccurrenceUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class EventOccurrenceUsageValidator : DtoValidator public EventOccurrenceUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs index 68bf86f52..b4c80a2b1 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExhibitStateUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.States; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ExhibitStateUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ExhibitStateUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ExhibitStateUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ExhibitStateUsageValidator : DtoValidator public ExhibitStateUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs index d5c3cd4fd..9429c6895 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Expression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Expression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class ExpressionValidator : DtoValidator /// public ExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs index fc5f60944..c9bde03f8 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureChainExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureChainExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureChainExpressionValidator : DtoValidator @@ -34,16 +34,9 @@ public sealed partial class FeatureChainExpressionValidator : DtoValidator public FeatureChainExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Operator).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs index 8e0eb1641..97e8ba698 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureChainingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureChaining metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureChaining metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureChainingValidator : DtoValidator @@ -33,19 +33,9 @@ public sealed partial class FeatureChainingValidator : DtoValidator public FeatureChainingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ChainingFeature).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs index b49b52f30..c73feebfe 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureInvertingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureInverting metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureInverting metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureInvertingValidator : DtoValidator @@ -33,20 +33,9 @@ public sealed partial class FeatureInvertingValidator : DtoValidator public FeatureInvertingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.FeatureInverted).NotEmpty(); this.RuleFor(dto => dto.InvertingFeature).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs index d00d178d7..62dee91d7 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class FeatureMembershipValidator : DtoValidator public FeatureMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs index de8924b36..55f8c3d92 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureReferenceExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureReferenceExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureReferenceExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureReferenceExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class FeatureReferenceExpressionValidator : DtoValidator public FeatureReferenceExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs index 50ef3e807..265e15087 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureTypingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureTypingValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class FeatureTypingValidator : DtoValidator /// public FeatureTypingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.Type).NotEmpty(); this.RuleFor(dto => dto.TypedFeature).NotEmpty(); } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs index 8da48f2ca..bf29f693a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Feature metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Feature metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class FeatureValidator : DtoValidator /// public FeatureValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs index 5c258b2cc..d433d93ee 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FeatureValueValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.FeatureValues; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FeatureValue metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FeatureValue metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FeatureValueValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class FeatureValueValidator : DtoValidator /// public FeatureValueValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs index 0737edfcf..fdcad7e91 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Flows; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FlowDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FlowDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FlowDefinitionValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class FlowDefinitionValidator : DtoValidator public FlowDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs index 3a805305f..1d56cafeb 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowEndValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Interactions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FlowEnd metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FlowEnd metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FlowEndValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class FlowEndValidator : DtoValidator /// public FlowEndValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs index 3e4e0754e..e3356a06a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Flows; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FlowUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FlowUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FlowUsageValidator : DtoValidator @@ -35,19 +35,8 @@ public sealed partial class FlowUsageValidator : DtoValidator /// public FlowUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs index 9be1c930f..e675925ef 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FlowValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Interactions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Flow metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Flow metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FlowValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class FlowValidator : DtoValidator /// public FlowValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs index f0052a269..b21921144 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForLoopActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ForLoopActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ForLoopActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ForLoopActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ForLoopActionUsageValidator : DtoValidator public ForLoopActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs index 8eff8fe10..b63ba46ff 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ForkNodeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ForkNode metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ForkNode metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ForkNodeValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ForkNodeValidator : DtoValidator /// public ForkNodeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs index c9ab44bfc..f41cfd6b9 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FramedConcernMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FramedConcernMembershipValidator : DtoValidator @@ -35,19 +35,10 @@ public sealed partial class FramedConcernMembershipValidator : DtoValidator public FramedConcernMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs index 7bdc07190..6b2d5ab97 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/FunctionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Function metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Function metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class FunctionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class FunctionValidator : DtoValidator /// public FunctionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs index 539876344..ad57ea638 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IfActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the IfActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the IfActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class IfActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class IfActionUsageValidator : DtoValidator /// public IfActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs index 0a04a815a..f22820d6d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IncludeUseCaseUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.UseCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the IncludeUseCaseUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the IncludeUseCaseUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class IncludeUseCaseUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class IncludeUseCaseUsageValidator : DtoValidator public IncludeUseCaseUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs index ef7c3030d..6b7d4d6a2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IndexExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the IndexExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the IndexExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class IndexExpressionValidator : DtoValidator @@ -34,16 +34,9 @@ public sealed partial class IndexExpressionValidator : DtoValidator public IndexExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Operator).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs index 8c59f9c36..86006e0cd 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InteractionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Interactions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Interaction metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Interaction metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class InteractionValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class InteractionValidator : DtoValidator /// public InteractionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs index 7876a8fab..186310b50 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Interfaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the InterfaceDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the InterfaceDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class InterfaceDefinitionValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class InterfaceDefinitionValidator : DtoValidator public InterfaceDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs index db10068b9..2a0b00bef 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InterfaceUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Interfaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the InterfaceUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the InterfaceUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class InterfaceUsageValidator : DtoValidator @@ -35,19 +35,8 @@ public sealed partial class InterfaceUsageValidator : DtoValidator public InterfaceUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs index 217e27f8a..ab0308ba1 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/IntersectingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Intersecting metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Intersecting metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class IntersectingValidator : DtoValidator @@ -33,19 +33,9 @@ public sealed partial class IntersectingValidator : DtoValidator /// public IntersectingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.IntersectingType).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs index 706ee961c..8d8d36f9b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvariantValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Invariant metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Invariant metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class InvariantValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class InvariantValidator : DtoValidator /// public InvariantValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs index 66b8ecd0d..6f2fd9998 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/InvocationExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the InvocationExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the InvocationExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class InvocationExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class InvocationExpressionValidator : DtoValidator public InvocationExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs index 507c59d8c..7b4f3cb77 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Items; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ItemDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ItemDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ItemDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ItemDefinitionValidator : DtoValidator public ItemDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs index 34fc33de0..1fad084fe 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ItemUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Items; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ItemUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ItemUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ItemUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ItemUsageValidator : DtoValidator /// public ItemUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs index ec99f2b7a..8de60020e 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/JoinNodeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the JoinNode metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the JoinNode metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class JoinNodeValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class JoinNodeValidator : DtoValidator /// public JoinNodeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs index 7365e182d..55c9941c6 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LibraryPackageValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Packages; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LibraryPackage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LibraryPackage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LibraryPackageValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class LibraryPackageValidator : DtoValidator public LibraryPackageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs index 331278842..4a5704d8b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralBooleanValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralBoolean metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralBoolean metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralBooleanValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralBooleanValidator : DtoValidator public LiteralBooleanValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs index fb470fdf4..5dab5ba17 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralExpressionValidator : DtoValidator public LiteralExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs index eb226b7fb..177fe847b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralInfinityValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInfinity metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInfinity metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralInfinityValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralInfinityValidator : DtoValidator public LiteralInfinityValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs index 24d78eccd..3b1031fe3 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralIntegerValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInteger metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralInteger metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralIntegerValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralIntegerValidator : DtoValidator public LiteralIntegerValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs index 373062592..fdfcbf134 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralRationalValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralRational metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralRational metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralRationalValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralRationalValidator : DtoValidator public LiteralRationalValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs index 75efb7ee2..e843fd2e4 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/LiteralStringValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the LiteralString metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the LiteralString metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class LiteralStringValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class LiteralStringValidator : DtoValidator /// public LiteralStringValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.Value).NotNull(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs index 187715a23..4b3b7b6f4 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipExposeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MembershipExpose metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MembershipExpose metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MembershipExposeValidator : DtoValidator @@ -34,19 +34,9 @@ public sealed partial class MembershipExposeValidator : DtoValidator public MembershipExposeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.ImportedMembership).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs index 9b2f63b5e..98ce2232b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipImportValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MembershipImport metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MembershipImport metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MembershipImportValidator : DtoValidator @@ -34,19 +34,9 @@ public sealed partial class MembershipImportValidator : DtoValidator public MembershipImportValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.ImportedMembership).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs index 930333510..f6dce33e5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Membership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Membership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MembershipValidator : DtoValidator @@ -34,19 +34,9 @@ public sealed partial class MembershipValidator : DtoValidator /// public MembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.MemberElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs index 5d3482710..a02c76981 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MergeNodeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MergeNode metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MergeNode metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MergeNodeValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class MergeNodeValidator : DtoValidator /// public MergeNodeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs index d5384df3d..450e1cdd7 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetaclassValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Metadata; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Metaclass metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Metaclass metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MetaclassValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class MetaclassValidator : DtoValidator /// public MetaclassValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs index ce65c1654..09522e328 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataAccessExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MetadataAccessExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataAccessExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MetadataAccessExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class MetadataAccessExpressionValidator : DtoValidator public MetadataAccessExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs index a3fa0a2b6..7f428fad1 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Metadata; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MetadataDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MetadataDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class MetadataDefinitionValidator : DtoValidator public MetadataDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs index a12e7160d..29c2322ab 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataFeatureValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Metadata; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MetadataFeature metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataFeature metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MetadataFeatureValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class MetadataFeatureValidator : DtoValidator public MetadataFeatureValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs index e516f679a..192cf76ce 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MetadataUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Metadata; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MetadataUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MetadataUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MetadataUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class MetadataUsageValidator : DtoValidator /// public MetadataUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs index 676523692..4b2ebaf62 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityRangeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Multiplicities; /// - /// Validates a against the multiplicities and types of the non-derived properties of the MultiplicityRange metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the MultiplicityRange metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MultiplicityRangeValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class MultiplicityRangeValidator : DtoValidator public MultiplicityRangeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs index 8c4f1c72e..512ff2343 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/MultiplicityValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Multiplicity metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Multiplicity metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class MultiplicityValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class MultiplicityValidator : DtoValidator /// public MultiplicityValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs index 0c799b174..cb233f508 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceExposeValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the NamespaceExpose metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the NamespaceExpose metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class NamespaceExposeValidator : DtoValidator @@ -34,19 +34,9 @@ public sealed partial class NamespaceExposeValidator : DtoValidator public NamespaceExposeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.ImportedNamespace).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs index 319a784f2..baf45979d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceImportValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the NamespaceImport metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the NamespaceImport metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class NamespaceImportValidator : DtoValidator @@ -34,19 +34,9 @@ public sealed partial class NamespaceImportValidator : DtoValidator public NamespaceImportValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.ImportedNamespace).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs index 053823d37..18abb2fc0 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NamespaceValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Namespace metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Namespace metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class NamespaceValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class NamespaceValidator : DtoValidator /// public NamespaceValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs index 570e012a2..f4c1f269b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/NullExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the NullExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the NullExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class NullExpressionValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class NullExpressionValidator : DtoValidator public NullExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs index bb9690977..3a6a3386c 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ObjectiveMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Cases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ObjectiveMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ObjectiveMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ObjectiveMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ObjectiveMembershipValidator : DtoValidator public ObjectiveMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs index 3dd3261ec..c4c7ff7fa 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Occurrences; /// - /// Validates a against the multiplicities and types of the non-derived properties of the OccurrenceDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the OccurrenceDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class OccurrenceDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class OccurrenceDefinitionValidator : DtoValidator public OccurrenceDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs index 14d7f821f..cce71a0bb 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OccurrenceUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Occurrences; /// - /// Validates a against the multiplicities and types of the non-derived properties of the OccurrenceUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the OccurrenceUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class OccurrenceUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class OccurrenceUsageValidator : DtoValidator public OccurrenceUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs index bbce949f8..0d7f26b49 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OperatorExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the OperatorExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the OperatorExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class OperatorExpressionValidator : DtoValidator @@ -34,16 +34,9 @@ public sealed partial class OperatorExpressionValidator : DtoValidator public OperatorExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Operator).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs index 4bed62238..b6fc18797 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/OwningMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Root.Namespaces; /// - /// Validates a against the multiplicities and types of the non-derived properties of the OwningMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the OwningMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class OwningMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class OwningMembershipValidator : DtoValidator public OwningMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs index 4e2967cdc..cd162401a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PackageValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Packages; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Package metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Package metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PackageValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class PackageValidator : DtoValidator /// public PackageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs index 6783e9fc0..266550f63 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ParameterMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Behaviors; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ParameterMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ParameterMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ParameterMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ParameterMembershipValidator : DtoValidator public ParameterMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs index 9b89dee1c..398b9cb4b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Parts; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PartDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PartDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PartDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class PartDefinitionValidator : DtoValidator public PartDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs index 58b3891d9..53aa0548d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PartUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Parts; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PartUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PartUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PartUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class PartUsageValidator : DtoValidator /// public PartUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs index 9c9e7d8cb..0c868efa6 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PayloadFeatureValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Interactions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PayloadFeature metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PayloadFeature metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PayloadFeatureValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class PayloadFeatureValidator : DtoValidator public PayloadFeatureValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs index 7c6c415db..41d6e0063 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PerformActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PerformActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PerformActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PerformActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class PerformActionUsageValidator : DtoValidator public PerformActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs index 89fcce156..9e6b9dbba 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortConjugationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Ports; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PortConjugation metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PortConjugation metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PortConjugationValidator : DtoValidator @@ -33,20 +33,10 @@ public sealed partial class PortConjugationValidator : DtoValidator public PortConjugationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ConjugatedType).NotEmpty(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.OriginalPortDefinition).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs index e5e8b1deb..57f31dad5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Ports; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PortDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PortDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PortDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class PortDefinitionValidator : DtoValidator public PortDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs index 6cee5b8c3..4257306a9 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PortUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Ports; /// - /// Validates a against the multiplicities and types of the non-derived properties of the PortUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the PortUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PortUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class PortUsageValidator : DtoValidator /// public PortUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs index 5448b133f..efee7f0d5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/PredicateValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Predicate metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Predicate metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class PredicateValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class PredicateValidator : DtoValidator /// public PredicateValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs index 4418f3bb9..8f135a867 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RedefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Redefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Redefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RedefinitionValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class RedefinitionValidator : DtoValidator /// public RedefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.RedefinedFeature).NotEmpty(); this.RuleFor(dto => dto.RedefiningFeature).NotEmpty(); } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs index bb5502dd9..37e72fb2f 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceSubsettingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceSubsetting metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceSubsetting metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ReferenceSubsettingValidator : DtoValidator @@ -33,18 +33,8 @@ public sealed partial class ReferenceSubsettingValidator : DtoValidator public ReferenceSubsettingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.ReferencedFeature).NotEmpty(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs index e7bc2bb15..be406bdb3 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReferenceUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ReferenceUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ReferenceUsageValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class ReferenceUsageValidator : DtoValidator public ReferenceUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs index e3263fa64..6e3df0fb2 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RenderingDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RenderingDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RenderingDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class RenderingDefinitionValidator : DtoValidator public RenderingDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs index 0259a6089..ead1904cc 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RenderingUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RenderingUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RenderingUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RenderingUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class RenderingUsageValidator : DtoValidator public RenderingUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs index 2eacd46bd..9b7a1e234 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementConstraintMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RequirementConstraintMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementConstraintMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RequirementConstraintMembershipValidator : DtoValidator @@ -35,19 +35,10 @@ public sealed partial class RequirementConstraintMembershipValidator : DtoValida /// public RequirementConstraintMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs index d57663a38..d9fd5026e 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RequirementDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RequirementDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class RequirementDefinitionValidator : DtoValidator public RequirementDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs index 25eaebdd6..f15c9d6f5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RequirementUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RequirementUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class RequirementUsageValidator : DtoValidator public RequirementUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs index 639c37d7a..5059f28ff 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/RequirementVerificationMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.VerificationCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the RequirementVerificationMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the RequirementVerificationMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class RequirementVerificationMembershipValidator : DtoValidator @@ -35,19 +35,10 @@ public sealed partial class RequirementVerificationMembershipValidator : DtoVali /// public RequirementVerificationMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs index 576552dc9..49511c5d3 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ResultExpressionMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ResultExpressionMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ResultExpressionMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ResultExpressionMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ResultExpressionMembershipValidator : DtoValidator public ResultExpressionMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs index 986eed0c9..a9eef9796 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ReturnParameterMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Functions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ReturnParameterMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ReturnParameterMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ReturnParameterMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ReturnParameterMembershipValidator : DtoValidator public ReturnParameterMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs index c654a6537..fc44b73cc 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SatisfyRequirementUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SatisfyRequirementUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SatisfyRequirementUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SatisfyRequirementUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class SatisfyRequirementUsageValidator : DtoValidator public SatisfyRequirementUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs index 271a5d853..26ccf3cd8 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SelectExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Expressions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SelectExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SelectExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SelectExpressionValidator : DtoValidator @@ -34,16 +34,9 @@ public sealed partial class SelectExpressionValidator : DtoValidator public SelectExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Operator).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs index bed5ae0fd..a7d58bb82 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SendActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SendActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SendActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SendActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class SendActionUsageValidator : DtoValidator public SendActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs index 70c270300..5fab1ed86 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SpecializationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Specialization metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Specialization metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SpecializationValidator : DtoValidator @@ -33,19 +33,8 @@ public sealed partial class SpecializationValidator : DtoValidator public SpecializationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.General).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.Specific).NotEmpty(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs index b7ba54410..204bd45d6 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StakeholderMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the StakeholderMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the StakeholderMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class StakeholderMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class StakeholderMembershipValidator : DtoValidator public StakeholderMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs index 55ee94c7f..a2017f0a6 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.States; /// - /// Validates a against the multiplicities and types of the non-derived properties of the StateDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the StateDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class StateDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class StateDefinitionValidator : DtoValidator public StateDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs index 49d5286cd..01414ae6d 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateSubactionMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.States; /// - /// Validates a against the multiplicities and types of the non-derived properties of the StateSubactionMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the StateSubactionMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class StateSubactionMembershipValidator : DtoValidator @@ -35,19 +35,10 @@ public sealed partial class StateSubactionMembershipValidator : DtoValidator public StateSubactionMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs index 9b8064d82..280d4c048 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StateUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.States; /// - /// Validates a against the multiplicities and types of the non-derived properties of the StateUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the StateUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class StateUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class StateUsageValidator : DtoValidator /// public StateUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs index ae98f7ddd..d0db3044a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StepValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Behaviors; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Step metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Step metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class StepValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class StepValidator : DtoValidator /// public StepValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs index b52dace5f..cb747dbca 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/StructureValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Kernel.Structures; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Structure metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Structure metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class StructureValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class StructureValidator : DtoValidator /// public StructureValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs index b5233a05e..c8afee987 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubclassificationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Classifiers; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Subclassification metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Subclassification metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SubclassificationValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class SubclassificationValidator : DtoValidator public SubclassificationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.Subclassifier).NotEmpty(); this.RuleFor(dto => dto.Superclassifier).NotEmpty(); } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs index 4b8febca3..6e3213958 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubjectMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Requirements; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SubjectMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SubjectMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SubjectMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class SubjectMembershipValidator : DtoValidator public SubjectMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs index 85ad28ab7..06c213f5b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SubsettingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Subsetting metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Subsetting metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SubsettingValidator : DtoValidator @@ -33,18 +33,7 @@ public sealed partial class SubsettingValidator : DtoValidator /// public SubsettingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.SubsettedFeature).NotEmpty(); this.RuleFor(dto => dto.SubsettingFeature).NotEmpty(); } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs index 5a0733eca..f033f4e2a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionAsUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Connections; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionAsUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionAsUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SuccessionAsUsageValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class SuccessionAsUsageValidator : DtoValidator public SuccessionAsUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs index f2881291b..ce7037231 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Flows; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionFlowUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionFlowUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SuccessionFlowUsageValidator : DtoValidator @@ -35,19 +35,8 @@ public sealed partial class SuccessionFlowUsageValidator : DtoValidator public SuccessionFlowUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs index e42d4d448..94403c91a 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionFlowValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Interactions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionFlow metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the SuccessionFlow metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SuccessionFlowValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class SuccessionFlowValidator : DtoValidator public SuccessionFlowValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs index 7c86cec75..4197eb268 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/SuccessionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Kernel.Connectors; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Succession metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Succession metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class SuccessionValidator : DtoValidator @@ -34,19 +34,8 @@ public sealed partial class SuccessionValidator : DtoValidator /// public SuccessionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs index ed279f3b2..3fafec59e 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TerminateActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TerminateActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TerminateActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TerminateActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class TerminateActionUsageValidator : DtoValidator public TerminateActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs index 486ab3e4b..7fe701395 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TextualRepresentationValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Root.Annotations; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TextualRepresentation metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TextualRepresentation metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TextualRepresentationValidator : DtoValidator @@ -33,16 +33,9 @@ public sealed partial class TextualRepresentationValidator : DtoValidator public TextualRepresentationValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Body).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Language).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs index e0162510a..0f87bb95b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionFeatureMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.States; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TransitionFeatureMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TransitionFeatureMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TransitionFeatureMembershipValidator : DtoValidator @@ -35,19 +35,10 @@ public sealed partial class TransitionFeatureMembershipValidator : DtoValidator< /// public TransitionFeatureMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs index 41dbdbf6b..95e7429cc 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TransitionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.States; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TransitionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TransitionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TransitionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class TransitionUsageValidator : DtoValidator public TransitionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs index 565ab0db6..31e3546b5 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TriggerInvocationExpressionValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TriggerInvocationExpression metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TriggerInvocationExpression metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TriggerInvocationExpressionValidator : DtoValidator @@ -35,16 +35,9 @@ public sealed partial class TriggerInvocationExpressionValidator : DtoValidator< /// public TriggerInvocationExpressionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.Kind).IsInEnum(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs index 31443c83f..651da4728 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeFeaturingValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Features; /// - /// Validates a against the multiplicities and types of the non-derived properties of the TypeFeaturing metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the TypeFeaturing metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TypeFeaturingValidator : DtoValidator @@ -33,20 +33,9 @@ public sealed partial class TypeFeaturingValidator : DtoValidator /// public TypeFeaturingValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); this.RuleFor(dto => dto.FeatureOfType).NotEmpty(); this.RuleFor(dto => dto.FeaturingType).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs index f0aa3aff2..30579773b 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/TypeValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Type metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Type metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class TypeValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class TypeValidator : DtoValidator /// public TypeValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs index 3690dc43a..288552dc9 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UnioningValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Core.Types; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Unioning metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Unioning metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class UnioningValidator : DtoValidator @@ -33,18 +33,8 @@ public sealed partial class UnioningValidator : DtoValidator /// public UnioningValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.UnioningType).NotEmpty(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs index 4af648182..ba8753393 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; /// - /// Validates a against the multiplicities and types of the non-derived properties of the Usage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the Usage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class UsageValidator : DtoValidator @@ -34,15 +34,8 @@ public sealed partial class UsageValidator : DtoValidator /// public UsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs index 3e196cd97..1abc46486 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.UseCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the UseCaseDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the UseCaseDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class UseCaseDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class UseCaseDefinitionValidator : DtoValidator public UseCaseDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs index 96bd051a3..d0d45cc94 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/UseCaseUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.UseCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the UseCaseUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the UseCaseUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class UseCaseUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class UseCaseUsageValidator : DtoValidator /// public UseCaseUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs index 542d2241b..6e1d0dba6 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VariantMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; /// - /// Validates a against the multiplicities and types of the non-derived properties of the VariantMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the VariantMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class VariantMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class VariantMembershipValidator : DtoValidator public VariantMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs index 3fd84b14d..9a8a17d89 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.VerificationCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the VerificationCaseDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the VerificationCaseDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class VerificationCaseDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class VerificationCaseDefinitionValidator : DtoValidator public VerificationCaseDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs index 2674346cc..4f57a5a85 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/VerificationCaseUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.VerificationCases; /// - /// Validates a against the multiplicities and types of the non-derived properties of the VerificationCaseUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the VerificationCaseUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class VerificationCaseUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class VerificationCaseUsageValidator : DtoValidator public VerificationCaseUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs index 8b7cf075e..d7a0a3690 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ViewDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ViewDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ViewDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ViewDefinitionValidator : DtoValidator public ViewDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs index 242085e6e..5f042c973 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewRenderingMembershipValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -23,7 +22,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ViewRenderingMembership metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ViewRenderingMembership metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ViewRenderingMembershipValidator : DtoValidator @@ -34,18 +34,9 @@ public sealed partial class ViewRenderingMembershipValidator : DtoValidator public ViewRenderingMembershipValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).NotNull(); - this.RuleFor(dto => dto.OwnedRelatedElement).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelatedElement).NotEmpty(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelatedElement).Must(value => !value.HasValue || value.Value != System.Guid.Empty); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); + this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty(); + this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty(); this.RuleFor(dto => dto.Visibility).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs index 1c882c13c..97d60d956 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ViewUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ViewUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ViewUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ViewUsageValidator : DtoValidator /// public ViewUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs index c530ba7f7..fa65d67ba 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointDefinitionValidator.cs @@ -15,14 +15,14 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ViewpointDefinition metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ViewpointDefinition metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ViewpointDefinitionValidator : DtoValidator @@ -33,14 +33,7 @@ public sealed partial class ViewpointDefinitionValidator : DtoValidator public ViewpointDefinitionValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); } } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs index c7826d64a..378c38957 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/ViewpointUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Views; /// - /// Validates a against the multiplicities and types of the non-derived properties of the ViewpointUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the ViewpointUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class ViewpointUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class ViewpointUsageValidator : DtoValidator public ViewpointUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs index 7d832a6e8..d0023b568 100644 --- a/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs +++ b/SysML2.NET.Validation/Core/DTO/AutoGenValidator/WhileLoopActionUsageValidator.cs @@ -15,7 +15,6 @@ namespace SysML2.NET.Validation.Core.DTO { using System.CodeDom.Compiler; - using System.Linq; using FluentValidation; @@ -24,7 +23,8 @@ namespace SysML2.NET.Validation.Core.DTO using SysML2.NET.Core.DTO.Systems.Actions; /// - /// Validates a against the multiplicities and types of the non-derived properties of the WhileLoopActionUsage metaclass + /// Validates a against the multiplicities and types of the non-derived properties of the WhileLoopActionUsage metaclass. + /// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type. /// [GeneratedCode("SysML2.NET", "latest")] public sealed partial class WhileLoopActionUsageValidator : DtoValidator @@ -35,15 +35,8 @@ public sealed partial class WhileLoopActionUsageValidator : DtoValidator public WhileLoopActionUsageValidator() { - this.RuleFor(dto => dto.AliasIds).NotNull(); - this.RuleFor(dto => dto.AliasIds).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.AliasIds).NotNull(); this.RuleFor(dto => dto.Direction).IsInEnum(); this.RuleFor(dto => dto.ElementId).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).NotNull(); - this.RuleFor(dto => dto.OwnedRelationship).Must(value => value == null || value.Distinct().Count() == value.Count); - this.RuleForEach(dto => dto.OwnedRelationship).NotEmpty(); - this.RuleFor(dto => dto.OwningRelationship).Must(value => !value.HasValue || value.Value != System.Guid.Empty); this.RuleFor(dto => dto.PortionKind).IsInEnum(); } } diff --git a/SysML2.NET/PIM/DTO/Project.cs b/SysML2.NET/PIM/DTO/Project.cs index 655c2c4f2..bae4e67ed 100644 --- a/SysML2.NET/PIM/DTO/Project.cs +++ b/SysML2.NET/PIM/DTO/Project.cs @@ -1,4 +1,4 @@ - // ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // // // Copyright (C) 2022-2026 Starion Group S.A. From d616b3ccbd354bd440f965ac3b0f9b191ed437af Mon Sep 17 00:00:00 2001 From: Zeynep Delal Mutlu Date: Wed, 18 Nov 2026 12:17:20 +0100 Subject: [PATCH 5/5] pr check --- .../HandleBarHelpers/DtoValidatorHelperTestFixture.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs index 67413f324..03087264f 100644 --- a/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/HandleBarHelpers/DtoValidatorHelperTestFixture.cs @@ -15,6 +15,7 @@ namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators using System.Text.RegularExpressions; using HandlebarsDotNet; + using HandlebarsDotNet.Helpers; using NUnit.Framework; @@ -122,6 +123,7 @@ public void VerifyRegisterDtoValidatorHelper() Assert.That(() => ((IHandlebars)null).RegisterDtoValidatorHelper(), Throws.TypeOf()); var handlebars = Handlebars.CreateSharedEnvironment(); + HandlebarsHelpers.Register(handlebars); handlebars.RegisterDtoValidatorHelper(); var template = handlebars.Compile("{{DtoValidator.WriteRules this}}");