diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/AnnotatingElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/AnnotatingElement.cs
index 8da41d1b5..b2a1aeae2 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/AnnotatingElement.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/AnnotatingElement.cs
@@ -31,6 +31,7 @@ namespace SysML2.NET.Core.POCO.Root.Annotations
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -40,8 +41,19 @@ namespace SysML2.NET.Core.POCO.Root.Annotations
///
[Class(xmiId: "_19_0_2_12e503d9_1594145576693_532940_27", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class AnnotatingElement : IAnnotatingElement
+ public partial class AnnotatingElement : IAnnotatingElement, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public AnnotatingElement()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -170,7 +182,10 @@ public partial class AnnotatingElement : IAnnotatingElement
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -213,7 +228,10 @@ public partial class AnnotatingElement : IAnnotatingElement
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs
index 8cb750bcd..07a5f3509 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs
@@ -35,6 +35,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Associations
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -44,8 +45,23 @@ namespace SysML2.NET.Core.POCO.Kernel.Associations
///
[Class(xmiId: "_18_5_3_12e503d9_1533160651716_116234_42240", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Association : IAssociation
+ public partial class Association : IAssociation, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Association()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -413,7 +429,10 @@ public partial class Association : IAssociation
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -421,7 +440,10 @@ public partial class Association : IAssociation
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -483,7 +505,10 @@ public partial class Association : IAssociation
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -491,7 +516,10 @@ public partial class Association : IAssociation
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Dependency.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Dependency.cs
index 6dd128047..8a3406055 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Dependency.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Dependency.cs
@@ -32,6 +32,7 @@ namespace SysML2.NET.Core.POCO.Root.Dependencies
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -43,8 +44,23 @@ namespace SysML2.NET.Core.POCO.Root.Dependencies
///
[Class(xmiId: "_19_0_2_12e503d9_1594006219028_628649_74", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Dependency : IDependency
+ public partial class Dependency : IDependency, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Dependency()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -161,7 +177,10 @@ public partial class Dependency : IDependency
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -169,7 +188,10 @@ public partial class Dependency : IDependency
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -203,7 +225,10 @@ public partial class Dependency : IDependency
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -211,7 +236,10 @@ public partial class Dependency : IDependency
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/EnumerationDefinition.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/EnumerationDefinition.cs
index 3182f8533..a6dae0497 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/EnumerationDefinition.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/EnumerationDefinition.cs
@@ -56,6 +56,7 @@ namespace SysML2.NET.Core.POCO.Systems.Enumerations
using SysML2.NET.Core.POCO.Systems.UseCases;
using SysML2.NET.Core.POCO.Systems.VerificationCases;
using SysML2.NET.Core.POCO.Systems.Views;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -65,8 +66,19 @@ namespace SysML2.NET.Core.POCO.Systems.Enumerations
///
[Class(xmiId: "_19_0_4_12e503d9_1606946467364_179493_153", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class EnumerationDefinition : IEnumerationDefinition
+ public partial class EnumerationDefinition : IEnumerationDefinition, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public EnumerationDefinition()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -603,7 +615,10 @@ bool Systems.DefinitionAndUsage.IDefinition.IsVariation
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The RenderingUsages that are ownedUsages of this Definition.
@@ -737,7 +752,10 @@ bool Systems.DefinitionAndUsage.IDefinition.IsVariation
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Feature.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Feature.cs
index 19f0a5f63..6865c94fb 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Feature.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Feature.cs
@@ -34,6 +34,7 @@ namespace SysML2.NET.Core.POCO.Core.Features
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -56,8 +57,19 @@ namespace SysML2.NET.Core.POCO.Core.Features
///
[Class(xmiId: "_18_5_3_12e503d9_1533160651684_893483_42160", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Feature : IFeature
+ public partial class Feature : IFeature, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Feature()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -578,7 +590,10 @@ public partial class Feature : IFeature
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -669,7 +684,10 @@ public partial class Feature : IFeature
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FeatureTyping.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FeatureTyping.cs
index 90b729d52..8b962c8b4 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FeatureTyping.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FeatureTyping.cs
@@ -33,6 +33,7 @@ namespace SysML2.NET.Core.POCO.Core.Features
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -43,8 +44,23 @@ namespace SysML2.NET.Core.POCO.Core.Features
///
[Class(xmiId: "_18_5_3_12e503d9_1543180339807_437641_20928", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class FeatureTyping : IFeatureTyping
+ public partial class FeatureTyping : IFeatureTyping, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public FeatureTyping()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -169,7 +185,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -177,7 +196,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -220,7 +242,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -228,7 +253,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the specific Type of this Specialization and owns it as its owningRelatedElement.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs
index 339a691e3..a14f3624d 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs
@@ -39,6 +39,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Interactions
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -47,8 +48,23 @@ namespace SysML2.NET.Core.POCO.Kernel.Interactions
///
[Class(xmiId: "_18_5_3_b9102da_1536869417406_861526_17744", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Flow : IFlow
+ public partial class Flow : IFlow, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Flow()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -634,7 +650,10 @@ public partial class Flow : IFlow
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -642,7 +661,10 @@ public partial class Flow : IFlow
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -733,7 +755,10 @@ public partial class Flow : IFlow
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -741,7 +766,10 @@ public partial class Flow : IFlow
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs
index c3bb9fd41..249adf1d8 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs
@@ -37,6 +37,7 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
using SysML2.NET.Core.POCO.Systems.Constraints;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -45,8 +46,23 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements
///
[Class(xmiId: "_19_0_4_12e503d9_1617120429499_126250_3667", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class FramedConcernMembership : IFramedConcernMembership
+ public partial class FramedConcernMembership : IFramedConcernMembership, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public FramedConcernMembership()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -296,7 +312,10 @@ string Root.Namespaces.IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -304,7 +323,10 @@ string Root.Namespaces.IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -338,7 +360,10 @@ string Root.Namespaces.IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -346,7 +371,10 @@ string Root.Namespaces.IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that owns this FeatureMembership.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IElement.cs
index 2756493d2..093b28379 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IElement.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IElement.cs
@@ -124,7 +124,7 @@ public partial interface IElement
///
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
- List OwnedRelationship { get; set; }
+ IReadOnlyCollection OwnedRelationship { get; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -154,7 +154,7 @@ public partial interface IElement
///
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
- IRelationship OwningRelationship { get; set; }
+ IRelationship OwningRelationship { get; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IRelationship.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IRelationship.cs
index 365bad428..e646d4b75 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IRelationship.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IRelationship.cs
@@ -62,14 +62,14 @@ public partial interface IRelationship : IElement
///
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
- List OwnedRelatedElement { get; set; }
+ IReadOnlyCollection OwnedRelatedElement { get; }
///
/// The relatedElement of this Relationship that owns the Relationship, if any.
///
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
- IElement OwningRelatedElement { get; set; }
+ IElement OwningRelatedElement { get; }
///
/// The Elements that are related by this Relationship, derived as the union of the source and target
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralInteger.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralInteger.cs
index 00222b7a0..0086854e5 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralInteger.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralInteger.cs
@@ -37,6 +37,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -45,8 +46,19 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions
///
[Class(xmiId: "_18_5_3_12e503d9_1533160651681_567347_42153", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class LiteralInteger : ILiteralInteger
+ public partial class LiteralInteger : ILiteralInteger, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public LiteralInteger()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -593,7 +605,10 @@ public partial class LiteralInteger : ILiteralInteger
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -684,7 +699,10 @@ public partial class LiteralInteger : ILiteralInteger
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralRational.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralRational.cs
index 41085923e..43b72d548 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralRational.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/LiteralRational.cs
@@ -37,6 +37,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -45,8 +46,19 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions
///
[Class(xmiId: "_18_5_3_12e503d9_1533160651706_235283_42203", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class LiteralRational : ILiteralRational
+ public partial class LiteralRational : ILiteralRational, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public LiteralRational()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -593,7 +605,10 @@ public partial class LiteralRational : ILiteralRational
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -684,7 +699,10 @@ public partial class LiteralRational : ILiteralRational
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs
index e6639c8a8..75f07285c 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs
@@ -32,6 +32,7 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces
using SysML2.NET.Core.Root.Namespaces;
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -46,8 +47,23 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces
///
[Class(xmiId: "_18_5_3_12e503d9_1533160651680_888716_42152", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Membership : IMembership
+ public partial class Membership : IMembership, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Membership()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -195,7 +211,10 @@ public partial class Membership : IMembership
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -203,7 +222,10 @@ public partial class Membership : IMembership
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -237,7 +259,10 @@ public partial class Membership : IMembership
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -245,7 +270,10 @@ public partial class Membership : IMembership
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/MultiplicityRange.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/MultiplicityRange.cs
index 2d7f32996..60ebbc4ca 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/MultiplicityRange.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/MultiplicityRange.cs
@@ -36,6 +36,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Multiplicities
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -49,8 +50,19 @@ namespace SysML2.NET.Core.POCO.Kernel.Multiplicities
///
[Class(xmiId: "_19_0_2_12e503d9_1573086225407_540120_4572", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class MultiplicityRange : IMultiplicityRange
+ public partial class MultiplicityRange : IMultiplicityRange, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public MultiplicityRange()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -590,7 +602,10 @@ public partial class MultiplicityRange : IMultiplicityRange
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -681,7 +696,10 @@ public partial class MultiplicityRange : IMultiplicityRange
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs
index 5f12071d2..d6bed4181 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs
@@ -32,6 +32,7 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces
using SysML2.NET.Core.Root.Namespaces;
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -40,8 +41,23 @@ namespace SysML2.NET.Core.POCO.Root.Namespaces
///
[Class(xmiId: "_19_0_4_12e503d9_1648180804650_933390_31", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class OwningMembership : IOwningMembership
+ public partial class OwningMembership : IOwningMembership, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public OwningMembership()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -239,7 +255,10 @@ string IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -247,7 +266,10 @@ string IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -281,7 +303,10 @@ string IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -289,7 +314,10 @@ string IMembership.MemberShortName
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs
index 66c45f598..847b9496a 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs
@@ -33,6 +33,7 @@ namespace SysML2.NET.Core.POCO.Core.Features
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -45,8 +46,23 @@ namespace SysML2.NET.Core.POCO.Core.Features
///
[Class(xmiId: "_19_0_4_12e503d9_1661554793960_500657_60", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class ReferenceSubsetting : IReferenceSubsetting
+ public partial class ReferenceSubsetting : IReferenceSubsetting, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public ReferenceSubsetting()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -174,7 +190,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -182,7 +201,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -226,7 +248,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -234,7 +259,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the specific Type of this Specialization and owns it as its owningRelatedElement.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs
index 1ba1ac06b..e0566269d 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs
@@ -61,6 +61,7 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements
using SysML2.NET.Core.POCO.Systems.UseCases;
using SysML2.NET.Core.POCO.Systems.VerificationCases;
using SysML2.NET.Core.POCO.Systems.Views;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -68,8 +69,19 @@ namespace SysML2.NET.Core.POCO.Systems.Requirements
///
[Class(xmiId: "_19_0_2_12e503d9_1582991078230_41497_1143", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class RequirementUsage : IRequirementUsage
+ public partial class RequirementUsage : IRequirementUsage, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public RequirementUsage()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -959,7 +971,10 @@ bool Core.Features.IFeature.IsVariable
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -1058,7 +1073,10 @@ bool Core.Features.IFeature.IsVariable
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/SelectExpression.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/SelectExpression.cs
index 76e170ce7..bc1af91d2 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/SelectExpression.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/SelectExpression.cs
@@ -37,6 +37,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -45,8 +46,19 @@ namespace SysML2.NET.Core.POCO.Kernel.Expressions
///
[Class(xmiId: "_18_5_3_12e503d9_1559596717567_82711_29088", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class SelectExpression : ISelectExpression
+ public partial class SelectExpression : ISelectExpression, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public SelectExpression()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -634,7 +646,10 @@ string IOperatorExpression.Operator
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -725,7 +740,10 @@ string IOperatorExpression.Operator
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Subclassification.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Subclassification.cs
index 9f9d4d44b..dde5e8f0b 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Subclassification.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Subclassification.cs
@@ -33,6 +33,7 @@ namespace SysML2.NET.Core.POCO.Core.Classifiers
using SysML2.NET.Core.POCO.Root.Annotations;
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -41,8 +42,23 @@ namespace SysML2.NET.Core.POCO.Core.Classifiers
///
[Class(xmiId: "_18_5_3_12e503d9_1543188778639_872842_24973", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Subclassification : ISubclassification
+ public partial class Subclassification : ISubclassification, IContainedRelationship
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Subclassification()
+ {
+ ((IContainedRelationship)this).OwnedRelatedElement = new ContainerList(this,
+ (element, relationship) => ((IContainedElement)element).OwningRelationship = relationship,
+ element => element.OwningRelationship);
+
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -170,7 +186,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
- public List OwnedRelatedElement { get; set; } = [];
+ public IReadOnlyCollection OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
+
+ /// Backing field for IRelationship.OwnedRelatedElement
+ ContainerList IContainedRelationship.OwnedRelatedElement { get; set; }
///
/// The Relationships for which this Element is the owningRelatedElement.
@@ -178,7 +197,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -220,7 +242,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_693018_16749", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
[Implements(implementation: "IRelationship.OwningRelatedElement")]
- public IElement OwningRelatedElement { get; set; }
+ public IElement OwningRelatedElement => ((IContainedRelationship)this).OwningRelatedElement;
+
+ /// Backing field for IRelationship.OwningRelatedElement
+ IElement IContainedRelationship.OwningRelatedElement { get; set; }
///
/// The Relationship for which this Element is an ownedRelatedElement, if any.
@@ -228,7 +253,10 @@ IType Core.Types.ISpecialization.General
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the specific Type of this Specialization and owns it as its owningRelatedElement.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/TextualRepresentation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/TextualRepresentation.cs
index 6b41cac3b..732a887a2 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/TextualRepresentation.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/TextualRepresentation.cs
@@ -31,6 +31,7 @@ namespace SysML2.NET.Core.POCO.Root.Annotations
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -65,8 +66,19 @@ namespace SysML2.NET.Core.POCO.Root.Annotations
///
[Class(xmiId: "_19_0_2_12e503d9_1594152214531_455349_2448", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class TextualRepresentation : ITextualRepresentation
+ public partial class TextualRepresentation : ITextualRepresentation, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public TextualRepresentation()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -210,7 +222,10 @@ public partial class TextualRepresentation : ITextualRepresentation
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -253,7 +268,10 @@ public partial class TextualRepresentation : ITextualRepresentation
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The full ownership-qualified name of this Element, represented in a form that is valid according to
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs
index 98f93c39d..e07a842bb 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs
@@ -57,6 +57,7 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage
using SysML2.NET.Core.POCO.Systems.UseCases;
using SysML2.NET.Core.POCO.Systems.VerificationCases;
using SysML2.NET.Core.POCO.Systems.Views;
+ using SysML2.NET.Collections;
using SysML2.NET.Decorators;
///
@@ -71,8 +72,19 @@ namespace SysML2.NET.Core.POCO.Systems.DefinitionAndUsage
///
[Class(xmiId: "_18_5_3_12e503d9_1565469997820_598571_19982", isAbstract: false, isFinalSpecialization: false, isActive: false)]
[GeneratedCode("SysML2.NET", "latest")]
- public partial class Usage : IUsage
+ public partial class Usage : IUsage, IContainedElement
{
+ ///
+ /// Initialize a new instance of
+ ///
+ public Usage()
+ {
+ ((IContainedElement)this).OwnedRelationship = new ContainerList(this,
+ (relationship, element) => ((IContainedRelationship)relationship).OwningRelatedElement = element,
+ relationship => relationship.OwningRelatedElement);
+
+ }
+
///
/// Gets or sets the unique identifier
///
@@ -862,7 +874,10 @@ bool Core.Features.IFeature.IsVariable
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwnedRelationship")]
- public List OwnedRelationship { get; set; } = [];
+ public IReadOnlyCollection OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
+
+ /// Backing field for IElement.OwnedRelationship
+ ContainerList IContainedElement.OwnedRelationship { get; set; }
///
/// The ownedRelationships of this Type that are Specializations, for which the Type is the specific
@@ -961,7 +976,10 @@ bool Core.Features.IFeature.IsVariable
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_482273_43303", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
[Implements(implementation: "IElement.OwningRelationship")]
- public IRelationship OwningRelationship { get; set; }
+ public IRelationship OwningRelationship => ((IContainedElement)this).OwningRelationship;
+
+ /// Backing field for IElement.OwningRelationship
+ IRelationship IContainedElement.OwningRelationship { get; set; }
///
/// The Type that is the owningType of the owningFeatureMembership of this Feature.
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs
index 5e5b7f708..80b283d1f 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Root.Annotations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -81,7 +82,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -130,17 +131,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Annotations.Ann
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AssociationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AssociationExtensions.cs
index cecaaaf09..9f7cb5157 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AssociationExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/AssociationExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Kernel.Associations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -87,7 +88,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -96,7 +97,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -145,7 +146,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Associations.
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -155,26 +156,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Associations.
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs
index 5fe72f8e4..d3b2b7c08 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Root.Dependencies;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -91,7 +92,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -100,7 +101,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -167,7 +168,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Dependencies.De
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -177,26 +178,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Dependencies.De
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
var supplierToAdd = dto.Supplier.Except(poco.Supplier.Select(x => x.Id));
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs
index bdb5c4f6a..02f8ccf9f 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Systems.Enumerations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -87,7 +88,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -136,17 +137,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Systems.Enumerations
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureExtensions.cs
index f76ac9f25..26345175d 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Core.Features;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -103,7 +104,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -152,17 +153,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Features.Featur
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs
index 1d69a3329..9ea1913c3 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Core.Features;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -83,7 +84,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -92,7 +93,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -141,7 +142,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Features.Featur
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -151,26 +152,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Features.Featur
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
if (cache.TryGetValue(dto.Type, out lazyPoco))
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FlowExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FlowExtensions.cs
index a396d7687..22260590d 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FlowExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FlowExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Kernel.Interactions;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -105,7 +106,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -114,7 +115,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -163,7 +164,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Interactions.
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -173,26 +174,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Interactions.
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs
index 9074bcd3d..a2e34e7db 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Systems.Requirements;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -85,7 +86,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -94,7 +95,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -145,7 +146,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Systems.Requirements
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -155,26 +156,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Systems.Requirements
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs
index 72963acdd..d44cb165f 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Kernel.Expressions;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -103,7 +104,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -154,17 +155,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Expressions.L
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs
index bb9c64ed7..a69010fb3 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Kernel.Expressions;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -103,7 +104,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -154,17 +155,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Expressions.L
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs
index cb24cbc8a..a60876c51 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Root.Namespaces;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -87,7 +88,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -96,7 +97,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -156,7 +157,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Namespaces.Memb
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -166,26 +167,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Namespaces.Memb
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs
index 08c9c86bb..cb20e2e24 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Kernel.Multiplicities;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -103,7 +104,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -152,17 +153,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Multiplicitie
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs
index e853c884c..ccfdc3f56 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Root.Namespaces;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -83,7 +84,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -92,7 +93,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -143,7 +144,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Namespaces.Owni
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -153,26 +154,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Namespaces.Owni
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs
index b082fc1ce..98fd68d5e 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Core.Features;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -83,7 +84,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -92,7 +93,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -141,7 +142,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Features.Refere
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -151,26 +152,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Features.Refere
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
if (cache.TryGetValue(dto.ReferencedFeature, out lazyPoco))
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs
index 48de9b49d..865a4ee0e 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Systems.Requirements;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -103,7 +104,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -156,17 +157,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Systems.Requirements
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs
index d143d866b..6d421bbc7 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Kernel.Expressions;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -105,7 +106,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -154,17 +155,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Kernel.Expressions.S
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs
index f0c5181d1..b6ac60748 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Core.Classifiers;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -83,7 +84,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelatedElementToDelete)
{
- poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
+ ((IContainedRelationship)poco).OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete);
@@ -92,7 +93,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -141,7 +142,7 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Classifiers.Sub
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelatedElement.Add(lazyPoco.Value);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(lazyPoco.Value);
}
}
@@ -151,26 +152,26 @@ public static void UpdateReferenceProperties(this Core.POCO.Core.Classifiers.Sub
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco))
{
- poco.OwningRelatedElement = lazyPoco.Value;
+ ((IContainedRelationship)poco).OwningRelatedElement = lazyPoco.Value;
}
else
{
- poco.OwningRelatedElement = null;
+ ((IContainedRelationship)poco).OwningRelatedElement = null;
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
if (cache.TryGetValue(dto.Subclassifier, out lazyPoco))
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs
index 305c3b985..903aa3bad 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Root.Annotations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -85,7 +86,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -134,17 +135,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Root.Annotations.Tex
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/UsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/UsageExtensions.cs
index 0d0cd01f0..a9a1b12ef 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/UsageExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/UsageExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Dal
using System.Linq;
using Core.POCO.Systems.DefinitionAndUsage;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// A static class that provides extension methods for the class
@@ -103,7 +104,7 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(t
foreach (var identifier in ownedRelationshipToDelete)
{
- poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
+ ((IContainedElement)poco).OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
}
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
@@ -152,17 +153,17 @@ public static void UpdateReferenceProperties(this Core.POCO.Systems.DefinitionAn
{
if (cache.TryGetValue(identifier, out lazyPoco))
{
- poco.OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
+ ((IContainedElement)poco).OwnedRelationship.Add((Core.POCO.Root.Elements.IRelationship)lazyPoco.Value);
}
}
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
{
- poco.OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
+ ((IContainedElement)poco).OwningRelationship = (Core.POCO.Root.Elements.IRelationship)lazyPoco.Value;
}
else
{
- poco.OwningRelationship = null;
+ ((IContainedElement)poco).OwningRelationship = null;
}
}
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AnnotatingElementExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AnnotatingElementExtensions.cs
index 0e8c8f5f7..b4de8c5c9 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AnnotatingElementExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AnnotatingElementExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AssociationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AssociationExtensions.cs
index ceb931a28..4037a1ff4 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AssociationExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/AssociationExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -155,7 +156,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -178,7 +179,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/DependencyExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/DependencyExtensions.cs
index b893a938d..2658ec4ee 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/DependencyExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/DependencyExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -178,7 +179,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -201,7 +202,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/EnumerationDefinitionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/EnumerationDefinitionExtensions.cs
index c5036bfc0..a714bf647 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/EnumerationDefinitionExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/EnumerationDefinitionExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureExtensions.cs
index 400f8e1a0..63a3c0479 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureTypingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureTypingExtensions.cs
index 88243ed4f..ea8f3bc2c 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureTypingExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FeatureTypingExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -193,7 +194,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -216,7 +217,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FlowExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FlowExtensions.cs
index 98184fda7..a8b7cb45c 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FlowExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FlowExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -155,7 +156,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -178,7 +179,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FramedConcernMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FramedConcernMembershipExtensions.cs
index 73358929e..36539d249 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FramedConcernMembershipExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/FramedConcernMembershipExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -155,7 +156,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -178,7 +179,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralIntegerExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralIntegerExtensions.cs
index fe3b9fe77..082678cc2 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralIntegerExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralIntegerExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralRationalExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralRationalExtensions.cs
index 9e90871dd..5c49509a5 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralRationalExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/LiteralRationalExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MembershipExtensions.cs
index 2e53dbcfc..5d261a524 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MembershipExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MembershipExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -116,7 +117,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -174,7 +175,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -197,7 +198,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MultiplicityRangeExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MultiplicityRangeExtensions.cs
index 8f430a98a..753dc450f 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MultiplicityRangeExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/MultiplicityRangeExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/OwningMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/OwningMembershipExtensions.cs
index 96089e98c..22779a661 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/OwningMembershipExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/OwningMembershipExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -155,7 +156,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -178,7 +179,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/ReferenceSubsettingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/ReferenceSubsettingExtensions.cs
index 036748527..f6cd59748 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/ReferenceSubsettingExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/ReferenceSubsettingExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -174,7 +175,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -197,7 +198,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/RequirementUsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/RequirementUsageExtensions.cs
index 0a8260ebe..cd0a2d1de 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/RequirementUsageExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/RequirementUsageExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SelectExpressionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SelectExpressionExtensions.cs
index 72cd23d75..46008de2f 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SelectExpressionExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SelectExpressionExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SubclassificationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SubclassificationExtensions.cs
index 9b777f6c4..525ed19aa 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SubclassificationExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/SubclassificationExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwningRelatedElement = owningRelatedElementReference;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementReference;
return;
}
@@ -97,7 +98,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -193,7 +194,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IElement");
}
- poco.OwnedRelatedElement.Add(ownedRelatedElementReference);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementReference);
}
return;
@@ -216,7 +217,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/TextualRepresentationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/TextualRepresentationExtensions.cs
index d25015f32..7062d68b9 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/TextualRepresentationExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/TextualRepresentationExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/UsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/UsageExtensions.cs
index c197e3740..969b8f58c 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/UsageExtensions.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoReferenceResolveExtension/UsageExtensions.cs
@@ -30,6 +30,7 @@ namespace SysML2.NET.Serializer.Xmi.Extensions
using Microsoft.Extensions.Logging;
using SysML2.NET.Common;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// Provides extensions methods for the to help resolve reference for properties
@@ -78,7 +79,7 @@ public static void ResolveAndAssignSingleValueReference(this SysML2.NET.Core.POC
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwningRelationship = owningRelationshipReference;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipReference;
return;
}
@@ -136,7 +137,7 @@ public static void ResolveAndAssignMultipleValueReferences(this SysML2.NET.Core.
throw new InvalidOperationException($"The referenced element with the id [{reference}] is a {referencedData.GetType().Name}, expected type: an IRelationship");
}
- poco.OwnedRelationship.Add(ownedRelationshipReference);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipReference);
}
return;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AnnotatingElementReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AnnotatingElementReader.cs
index d6273cd25..c61ad6030 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AnnotatingElementReader.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AnnotatingElementReader.cs
@@ -36,6 +36,7 @@ namespace SysML2.NET.Serializer.Xmi.Readers
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
using SysML2.NET.Core.POCO.Root.Annotations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// The purpose of the is to read an instance of
@@ -258,7 +259,7 @@ public override IAnnotatingElement Read(XmlReader xmiReader, Uri currentLocation
{
var ownedRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -279,7 +280,7 @@ public override IAnnotatingElement Read(XmlReader xmiReader, Uri currentLocation
{
var owningRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
@@ -486,7 +487,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Ur
{
var ownedRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -507,7 +508,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Ur
{
var owningRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AssociationReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AssociationReader.cs
index d992c5e92..8216d7169 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AssociationReader.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/AssociationReader.cs
@@ -40,6 +40,7 @@ namespace SysML2.NET.Serializer.Xmi.Readers
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
using SysML2.NET.Core.POCO.Kernel.Associations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// The purpose of the is to read an instance of
@@ -358,7 +359,7 @@ public override IAssociation Read(XmlReader xmiReader, Uri currentLocation)
{
var ownedRelatedElementValue = (IElement)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelatedElement.Add(ownedRelatedElementValue);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementValue);
}
break;
@@ -379,7 +380,7 @@ public override IAssociation Read(XmlReader xmiReader, Uri currentLocation)
{
var ownedRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -400,7 +401,7 @@ public override IAssociation Read(XmlReader xmiReader, Uri currentLocation)
{
var owningRelatedElementValue = (IElement)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelatedElement = owningRelatedElementValue;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementValue;
}
break;
@@ -421,7 +422,7 @@ public override IAssociation Read(XmlReader xmiReader, Uri currentLocation)
{
var owningRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
@@ -724,7 +725,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curr
{
var ownedRelatedElementValue = (IElement)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelatedElement.Add(ownedRelatedElementValue);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementValue);
}
break;
@@ -745,7 +746,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curr
{
var ownedRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -766,7 +767,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curr
{
var owningRelatedElementValue = (IElement)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelatedElement = owningRelatedElementValue;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementValue;
}
break;
@@ -787,7 +788,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curr
{
var owningRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/DependencyReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/DependencyReader.cs
index c2b3ef003..1264907be 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/DependencyReader.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/DependencyReader.cs
@@ -37,6 +37,7 @@ namespace SysML2.NET.Serializer.Xmi.Readers
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
using SysML2.NET.Core.POCO.Root.Dependencies;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// The purpose of the is to read an instance of
@@ -372,7 +373,7 @@ public override IDependency Read(XmlReader xmiReader, Uri currentLocation)
{
var ownedRelatedElementValue = (IElement)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelatedElement.Add(ownedRelatedElementValue);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementValue);
}
break;
@@ -393,7 +394,7 @@ public override IDependency Read(XmlReader xmiReader, Uri currentLocation)
{
var ownedRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -414,7 +415,7 @@ public override IDependency Read(XmlReader xmiReader, Uri currentLocation)
{
var owningRelatedElementValue = (IElement)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelatedElement = owningRelatedElementValue;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementValue;
}
break;
@@ -435,7 +436,7 @@ public override IDependency Read(XmlReader xmiReader, Uri currentLocation)
{
var owningRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
@@ -776,7 +777,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curre
{
var ownedRelatedElementValue = (IElement)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelatedElement.Add(ownedRelatedElementValue);
+ ((IContainedRelationship)poco).OwnedRelatedElement.Add(ownedRelatedElementValue);
}
break;
@@ -797,7 +798,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curre
{
var ownedRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -818,7 +819,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curre
{
var owningRelatedElementValue = (IElement)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelatedElement = owningRelatedElementValue;
+ ((IContainedRelationship)poco).OwningRelatedElement = owningRelatedElementValue;
}
break;
@@ -839,7 +840,7 @@ public override async Task ReadAsync(XmlReader xmiReader, Uri curre
{
var owningRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/EnumerationDefinitionReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/EnumerationDefinitionReader.cs
index ec2a9e9f3..32b744c87 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/EnumerationDefinitionReader.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/EnumerationDefinitionReader.cs
@@ -61,6 +61,7 @@ namespace SysML2.NET.Serializer.Xmi.Readers
using SysML2.NET.Core.POCO.Systems.VerificationCases;
using SysML2.NET.Core.POCO.Systems.Views;
using SysML2.NET.Core.POCO.Systems.Enumerations;
+ using SysML2.NET.Core.POCO.Root.Elements;
///
/// The purpose of the is to read an instance of
@@ -349,7 +350,7 @@ public override IEnumerationDefinition Read(XmlReader xmiReader, Uri currentLoca
{
var ownedRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -370,7 +371,7 @@ public override IEnumerationDefinition Read(XmlReader xmiReader, Uri currentLoca
{
var owningRelationshipValue = (IRelationship)this.XmiDataReaderFacade.QueryXmiData(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
@@ -643,7 +644,7 @@ public override async Task ReadAsync(XmlReader xmiReader
{
var ownedRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwnedRelationship.Add(ownedRelationshipValue);
+ ((IContainedElement)poco).OwnedRelationship.Add(ownedRelationshipValue);
}
break;
@@ -664,7 +665,7 @@ public override async Task ReadAsync(XmlReader xmiReader
{
var owningRelationshipValue = (IRelationship)await this.XmiDataReaderFacade.QueryXmiDataAsync(xmiReader, this.Cache, currentLocation, this.ExternalReferenceService, this.LoggerFactory);
- poco.OwningRelationship = owningRelationshipValue;
+ ((IContainedElement)poco).OwningRelationship = owningRelationshipValue;
}
break;
diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/FeatureReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/FeatureReader.cs
index 4007426e4..420b09617 100644
--- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/FeatureReader.cs
+++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenReaders/FeatureReader.cs
@@ -39,6 +39,7 @@ namespace SysML2.NET.Serializer.Xmi.Readers
using SysML2.NET.Core.POCO.Root.Elements;
using SysML2.NET.Core.POCO.Root.Namespaces;
using SysML2.NET.Core.POCO.Core.Features;
+ using SysML2.NET.Core.POCO.Root.Elements;
///