Skip to content

Commit eb37a71

Browse files
Getter for DTO : new collection instead of original collection, to forbid modification
1 parent 5e7f76c commit eb37a71

97 files changed

Lines changed: 290 additions & 290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ private static string GetRedefinedPropertyGetterImplementationForDto(IProperty r
644644

645645
if (redefinedProperty.QueryIsEnumerable() && redefinition.QueryIsEnumerable())
646646
{
647-
return $"{redefinitionPropertyName};";
647+
return $"[..{redefinitionPropertyName}];";
648648
}
649649

650650
if (redefinedProperty.QueryIsEnumerable() && !redefinition.QueryIsEnumerable())

SysML2.NET/Core/AutoGenDto/AcceptActionUsage.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public partial class AcceptActionUsage : IAcceptActionUsage
7575
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
7676
[RedefinedByProperty("IActionUsage.ActionDefinition")]
7777
[Implements(implementation: "IStep.Behavior")]
78-
List<Guid> Kernel.Behaviors.IStep.behavior => this.actionDefinition;
78+
List<Guid> Kernel.Behaviors.IStep.behavior => [.. this.actionDefinition];
7979

8080
/// <summary>
8181
/// The Feature that are chained together to determine the values of this Feature, derived from the
@@ -125,7 +125,7 @@ public partial class AcceptActionUsage : IAcceptActionUsage
125125
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
126126
[RedefinedByProperty("IOccurrenceUsage.OccurrenceDefinition")]
127127
[Implements(implementation: "IUsage.Definition")]
128-
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => ((SysML2.NET.Core.DTO.Systems.Occurrences.IOccurrenceUsage)this).occurrenceDefinition;
128+
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => [.. ((SysML2.NET.Core.DTO.Systems.Occurrences.IOccurrenceUsage)this).occurrenceDefinition];
129129

130130
/// <summary>
131131
/// The interpretations of a Type with differencingTypes are asserted to be those of the first of those
@@ -147,7 +147,7 @@ public partial class AcceptActionUsage : IAcceptActionUsage
147147
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
148148
[RedefinedByProperty("IStep.Parameter")]
149149
[Implements(implementation: "IType.DirectedFeature")]
150-
List<Guid> Core.Types.IType.directedFeature => this.parameter;
150+
List<Guid> Core.Types.IType.directedFeature => [.. this.parameter];
151151

152152
/// <summary>
153153
/// The usages of this Usage that are directedFeatures.
@@ -707,7 +707,7 @@ bool Core.Features.IFeature.IsVariable
707707
[RedefinedProperty(propertyName: "_19_0_2_12e503d9_1591477641252_179221_958")]
708708
[RedefinedByProperty("IActionUsage.ActionDefinition")]
709709
[Implements(implementation: "IOccurrenceUsage.OccurrenceDefinition")]
710-
List<Guid> Systems.Occurrences.IOccurrenceUsage.occurrenceDefinition => this.actionDefinition;
710+
List<Guid> Systems.Occurrences.IOccurrenceUsage.occurrenceDefinition => [.. this.actionDefinition];
711711

712712
/// <summary>
713713
/// All features related to this Type by FeatureMemberships that have direction out or inout.
@@ -1086,7 +1086,7 @@ bool Core.Features.IFeature.IsVariable
10861086
[Property(xmiId: "_18_5_3_12e503d9_1533160674969_376003_43216", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: true, defaultValue: null)]
10871087
[RedefinedByProperty("IUsage.Definition")]
10881088
[Implements(implementation: "IFeature.Type")]
1089-
List<Guid> Core.Features.IFeature.type => ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition;
1089+
List<Guid> Core.Features.IFeature.type => [.. ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition];
10901090

10911091
/// <summary>
10921092
/// The interpretations of a Type with unioningTypes are asserted to be the same as those of all the

SysML2.NET/Core/AutoGenDto/ActionDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public partial class ActionDefinition : IActionDefinition
101101
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
102102
[RedefinedByProperty("IBehavior.Parameter")]
103103
[Implements(implementation: "IType.DirectedFeature")]
104-
List<Guid> Core.Types.IType.directedFeature => this.parameter;
104+
List<Guid> Core.Types.IType.directedFeature => [.. this.parameter];
105105

106106
/// <summary>
107107
/// The usages of this Definition that are directedFeatures.

SysML2.NET/Core/AutoGenDto/ActionUsage.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public partial class ActionUsage : IActionUsage
7676
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
7777
[RedefinedByProperty("IActionUsage.ActionDefinition")]
7878
[Implements(implementation: "IStep.Behavior")]
79-
List<Guid> Kernel.Behaviors.IStep.behavior => this.actionDefinition;
79+
List<Guid> Kernel.Behaviors.IStep.behavior => [.. this.actionDefinition];
8080

8181
/// <summary>
8282
/// The Feature that are chained together to determine the values of this Feature, derived from the
@@ -126,7 +126,7 @@ public partial class ActionUsage : IActionUsage
126126
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
127127
[RedefinedByProperty("IOccurrenceUsage.OccurrenceDefinition")]
128128
[Implements(implementation: "IUsage.Definition")]
129-
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => ((SysML2.NET.Core.DTO.Systems.Occurrences.IOccurrenceUsage)this).occurrenceDefinition;
129+
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => [.. ((SysML2.NET.Core.DTO.Systems.Occurrences.IOccurrenceUsage)this).occurrenceDefinition];
130130

131131
/// <summary>
132132
/// The interpretations of a Type with differencingTypes are asserted to be those of the first of those
@@ -148,7 +148,7 @@ public partial class ActionUsage : IActionUsage
148148
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
149149
[RedefinedByProperty("IStep.Parameter")]
150150
[Implements(implementation: "IType.DirectedFeature")]
151-
List<Guid> Core.Types.IType.directedFeature => this.parameter;
151+
List<Guid> Core.Types.IType.directedFeature => [.. this.parameter];
152152

153153
/// <summary>
154154
/// The usages of this Usage that are directedFeatures.
@@ -708,7 +708,7 @@ bool Core.Features.IFeature.IsVariable
708708
[RedefinedProperty(propertyName: "_19_0_2_12e503d9_1591477641252_179221_958")]
709709
[RedefinedByProperty("IActionUsage.ActionDefinition")]
710710
[Implements(implementation: "IOccurrenceUsage.OccurrenceDefinition")]
711-
List<Guid> Systems.Occurrences.IOccurrenceUsage.occurrenceDefinition => this.actionDefinition;
711+
List<Guid> Systems.Occurrences.IOccurrenceUsage.occurrenceDefinition => [.. this.actionDefinition];
712712

713713
/// <summary>
714714
/// All features related to this Type by FeatureMemberships that have direction out or inout.
@@ -1062,7 +1062,7 @@ bool Core.Features.IFeature.IsVariable
10621062
[Property(xmiId: "_18_5_3_12e503d9_1533160674969_376003_43216", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: true, defaultValue: null)]
10631063
[RedefinedByProperty("IUsage.Definition")]
10641064
[Implements(implementation: "IFeature.Type")]
1065-
List<Guid> Core.Features.IFeature.type => ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition;
1065+
List<Guid> Core.Features.IFeature.type => [.. ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition];
10661066

10671067
/// <summary>
10681068
/// The interpretations of a Type with unioningTypes are asserted to be the same as those of all the

SysML2.NET/Core/AutoGenDto/AllocationDefinition.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public partial class AllocationDefinition : IAllocationDefinition
7474
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1562476168385_824569_22106")]
7575
[RedefinedByProperty("IConnectionDefinition.ConnectionEnd")]
7676
[Implements(implementation: "IAssociation.AssociationEnd")]
77-
List<Guid> Kernel.Associations.IAssociation.associationEnd => this.connectionEnd;
77+
List<Guid> Kernel.Associations.IAssociation.associationEnd => [.. this.connectionEnd];
7878

7979
/// <summary>
8080
/// The Usages that define the things related by the ConnectionDefinition.
@@ -155,7 +155,7 @@ public partial class AllocationDefinition : IAllocationDefinition
155155
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
156156
[RedefinedByProperty("IAssociation.AssociationEnd")]
157157
[Implements(implementation: "IType.EndFeature")]
158-
List<Guid> Core.Types.IType.endFeature => ((SysML2.NET.Core.DTO.Kernel.Associations.IAssociation)this).associationEnd;
158+
List<Guid> Core.Types.IType.endFeature => [.. ((SysML2.NET.Core.DTO.Kernel.Associations.IAssociation)this).associationEnd];
159159

160160
/// <summary>
161161
/// The ownedMemberFeatures of the featureMemberships of this Type.
@@ -785,7 +785,7 @@ bool Core.Types.IType.IsSufficient
785785
[Property(xmiId: "_18_5_3_12e503d9_1533160674961_132339_43177", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: false, defaultValue: null)]
786786
[RedefinedByProperty("IAssociation.RelatedType")]
787787
[Implements(implementation: "IRelationship.RelatedElement")]
788-
List<Guid> Root.Elements.IRelationship.relatedElement => this.relatedType;
788+
List<Guid> Root.Elements.IRelationship.relatedElement => [.. this.relatedType];
789789

790790
/// <summary>
791791
/// The types of the associationEnds of the Association, which are the relatedElements of the
@@ -837,7 +837,7 @@ List<Guid> Root.Elements.IRelationship.Source
837837
[Implements(implementation: "IRelationship.Target")]
838838
List<Guid> Root.Elements.IRelationship.Target
839839
{
840-
get => this.targetType;
840+
get => [.. this.targetType];
841841
set { }
842842
}
843843

SysML2.NET/Core/AutoGenDto/AllocationUsage.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public partial class AllocationUsage : IAllocationUsage
7070
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
7171
[RedefinedByProperty("IConnectionUsage.ConnectionDefinition")]
7272
[Implements(implementation: "IConnector.Association")]
73-
List<Guid> Kernel.Connectors.IConnector.association => ((SysML2.NET.Core.DTO.Systems.Connections.IConnectionUsage)this).connectionDefinition;
73+
List<Guid> Kernel.Connectors.IConnector.association => [.. ((SysML2.NET.Core.DTO.Systems.Connections.IConnectionUsage)this).connectionDefinition];
7474

7575
/// <summary>
7676
/// The Feature that are chained together to determine the values of this Feature, derived from the
@@ -94,7 +94,7 @@ public partial class AllocationUsage : IAllocationUsage
9494
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674983_471497_43284")]
9595
[RedefinedByProperty("IAllocationUsage.AllocationDefinition")]
9696
[Implements(implementation: "IConnectionUsage.ConnectionDefinition")]
97-
List<Guid> Systems.Connections.IConnectionUsage.connectionDefinition => this.allocationDefinition;
97+
List<Guid> Systems.Connections.IConnectionUsage.connectionDefinition => [.. this.allocationDefinition];
9898

9999
/// <summary>
100100
/// The endFeatures of a Connector, which redefine the endFeatures of the associations of the Connector.
@@ -151,7 +151,7 @@ public partial class AllocationUsage : IAllocationUsage
151151
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
152152
[RedefinedByProperty("IOccurrenceUsage.OccurrenceDefinition")]
153153
[Implements(implementation: "IUsage.Definition")]
154-
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => this.occurrenceDefinition;
154+
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => [.. this.occurrenceDefinition];
155155

156156
/// <summary>
157157
/// The interpretations of a Type with differencingTypes are asserted to be those of the first of those
@@ -215,7 +215,7 @@ public partial class AllocationUsage : IAllocationUsage
215215
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
216216
[RedefinedByProperty("IConnector.ConnectorEnd")]
217217
[Implements(implementation: "IType.EndFeature")]
218-
List<Guid> Core.Types.IType.endFeature => this.connectorEnd;
218+
List<Guid> Core.Types.IType.endFeature => [.. this.connectorEnd];
219219

220220
/// <summary>
221221
/// The Type that is related to this Feature by an EndFeatureMembership in which the Feature is an
@@ -1098,7 +1098,7 @@ bool Core.Features.IFeature.IsVariable
10981098
[Property(xmiId: "_18_5_3_12e503d9_1533160674961_132339_43177", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: false, defaultValue: null)]
10991099
[RedefinedByProperty("IConnector.RelatedFeature")]
11001100
[Implements(implementation: "IRelationship.RelatedElement")]
1101-
List<Guid> Root.Elements.IRelationship.relatedElement => this.relatedFeature;
1101+
List<Guid> Root.Elements.IRelationship.relatedElement => [.. this.relatedFeature];
11021102

11031103
/// <summary>
11041104
/// The Features that are related by this Connector considered as a Relationship and that restrict the
@@ -1150,7 +1150,7 @@ List<Guid> Root.Elements.IRelationship.Source
11501150
[Implements(implementation: "IRelationship.Target")]
11511151
List<Guid> Root.Elements.IRelationship.Target
11521152
{
1153-
get => this.targetFeature;
1153+
get => [.. this.targetFeature];
11541154
set { }
11551155
}
11561156

@@ -1182,7 +1182,7 @@ List<Guid> Root.Elements.IRelationship.Target
11821182
[Property(xmiId: "_18_5_3_12e503d9_1533160674969_376003_43216", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: true, defaultValue: null)]
11831183
[RedefinedByProperty("IUsage.Definition")]
11841184
[Implements(implementation: "IFeature.Type")]
1185-
List<Guid> Core.Features.IFeature.type => ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition;
1185+
List<Guid> Core.Features.IFeature.type => [.. ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition];
11861186

11871187
/// <summary>
11881188
/// The interpretations of a Type with unioningTypes are asserted to be the same as those of all the

SysML2.NET/Core/AutoGenDto/AnalysisCaseDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public partial class AnalysisCaseDefinition : IAnalysisCaseDefinition
117117
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
118118
[RedefinedByProperty("IBehavior.Parameter")]
119119
[Implements(implementation: "IType.DirectedFeature")]
120-
List<Guid> Core.Types.IType.directedFeature => this.parameter;
120+
List<Guid> Core.Types.IType.directedFeature => [.. this.parameter];
121121

122122
/// <summary>
123123
/// The usages of this Definition that are directedFeatures.

SysML2.NET/Core/AutoGenDto/AnalysisCaseUsage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public partial class AnalysisCaseUsage : IAnalysisCaseUsage
161161
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
162162
[RedefinedByProperty("IOccurrenceUsage.OccurrenceDefinition")]
163163
[Implements(implementation: "IUsage.Definition")]
164-
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => ((SysML2.NET.Core.DTO.Systems.Occurrences.IOccurrenceUsage)this).occurrenceDefinition;
164+
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => [.. ((SysML2.NET.Core.DTO.Systems.Occurrences.IOccurrenceUsage)this).occurrenceDefinition];
165165

166166
/// <summary>
167167
/// The interpretations of a Type with differencingTypes are asserted to be those of the first of those
@@ -183,7 +183,7 @@ public partial class AnalysisCaseUsage : IAnalysisCaseUsage
183183
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
184184
[RedefinedByProperty("IStep.Parameter")]
185185
[Implements(implementation: "IType.DirectedFeature")]
186-
List<Guid> Core.Types.IType.directedFeature => this.parameter;
186+
List<Guid> Core.Types.IType.directedFeature => [.. this.parameter];
187187

188188
/// <summary>
189189
/// The usages of this Usage that are directedFeatures.
@@ -768,7 +768,7 @@ bool Core.Features.IFeature.IsVariable
768768
[RedefinedProperty(propertyName: "_19_0_2_12e503d9_1591477641252_179221_958")]
769769
[RedefinedByProperty("IActionUsage.ActionDefinition")]
770770
[Implements(implementation: "IOccurrenceUsage.OccurrenceDefinition")]
771-
List<Guid> Systems.Occurrences.IOccurrenceUsage.occurrenceDefinition => ((SysML2.NET.Core.DTO.Systems.Actions.IActionUsage)this).actionDefinition;
771+
List<Guid> Systems.Occurrences.IOccurrenceUsage.occurrenceDefinition => [.. ((SysML2.NET.Core.DTO.Systems.Actions.IActionUsage)this).actionDefinition];
772772

773773
/// <summary>
774774
/// All features related to this Type by FeatureMemberships that have direction out or inout.
@@ -1151,7 +1151,7 @@ bool Core.Features.IFeature.IsVariable
11511151
[Property(xmiId: "_18_5_3_12e503d9_1533160674969_376003_43216", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: true, defaultValue: null)]
11521152
[RedefinedByProperty("IUsage.Definition")]
11531153
[Implements(implementation: "IFeature.Type")]
1154-
List<Guid> Core.Features.IFeature.type => ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition;
1154+
List<Guid> Core.Features.IFeature.type => [.. ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition];
11551155

11561156
/// <summary>
11571157
/// The interpretations of a Type with unioningTypes are asserted to be the same as those of all the

SysML2.NET/Core/AutoGenDto/AssertConstraintUsage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public partial class AssertConstraintUsage : IAssertConstraintUsage
132132
[RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674969_376003_43216")]
133133
[RedefinedByProperty("IOccurrenceUsage.OccurrenceDefinition")]
134134
[Implements(implementation: "IUsage.Definition")]
135-
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => this.occurrenceDefinition;
135+
List<Guid> Systems.DefinitionAndUsage.IUsage.definition => [.. this.occurrenceDefinition];
136136

137137
/// <summary>
138138
/// The interpretations of a Type with differencingTypes are asserted to be those of the first of those
@@ -154,7 +154,7 @@ public partial class AssertConstraintUsage : IAssertConstraintUsage
154154
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674959_326391_43166")]
155155
[RedefinedByProperty("IStep.Parameter")]
156156
[Implements(implementation: "IType.DirectedFeature")]
157-
List<Guid> Core.Types.IType.directedFeature => this.parameter;
157+
List<Guid> Core.Types.IType.directedFeature => [.. this.parameter];
158158

159159
/// <summary>
160160
/// The usages of this Usage that are directedFeatures.
@@ -1111,7 +1111,7 @@ bool Core.Features.IFeature.IsVariable
11111111
[Property(xmiId: "_18_5_3_12e503d9_1533160674969_376003_43216", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: true, isDerivedUnion: false, isUnique: true, defaultValue: null)]
11121112
[RedefinedByProperty("IUsage.Definition")]
11131113
[Implements(implementation: "IFeature.Type")]
1114-
List<Guid> Core.Features.IFeature.type => ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition;
1114+
List<Guid> Core.Features.IFeature.type => [.. ((SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.IUsage)this).definition];
11151115

11161116
/// <summary>
11171117
/// The interpretations of a Type with unioningTypes are asserted to be the same as those of all the

0 commit comments

Comments
 (0)