Class Copying
Allow for making shallow and deep copies of AAS model instances.
Inheritance
System.Object
Copying
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AasCore.Aas3_0
Assembly: AasCore.Aas3_0.dll
Syntax
public static class Copying
Methods
| Improve this Doc View SourceDeep<T>(T)
Make a recursively a deep copy of that
.
Declaration
public static T Deep<T>(T that)
where T : IClass
Parameters
Type | Name | Description |
---|---|---|
T | that | to be deeply copied in a recursive manner |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | type to cast the result to |
Shallow<T>(T)
Make a shallow copy of that
.
Declaration
public static T Shallow<T>(T that)
where T : IClass
Parameters
Type | Name | Description |
---|---|---|
T | that | to be copied in a shallow manner |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | type to cast the result to |
Remarks
All the properties are copied by reference. This includes also the lists. Hence, a list property is copied by reference, and not, as sometimes might be expected, as a new list of underlying references.