-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Oliver Ehrenmüller edited this page Apr 12, 2019
·
27 revisions
- Mark a class with
AddDeepCopyConstructor-Attribute to create a deep copy constructor. - Mark a static method with
DeepCopyExtension-Attribute to create a nullable deep copy method that supports inheritance. - Mark an existing copy constructor with
InjectDeepCopyto insert deep copy instructions before your code. [Details](Custom copy constructor) - Mark a property with
IgnoreDuringDeepCopyto skip this property. - Mark a property with
DeepCopyByReferenceto copy by reference. -
List<>andDictionary<,>are supported and described here
To create a compileable method to be used, you can simple return the parameter:
[DeepCopyExtension]
public static MyType DeepCopy(this MyType myType) => myType;or throw an exception
[DeepCopyExtension]
public static MyType DeepCopy(this MyType myType) => throw new NotImplementedException();- Fields
- References without copy constructor
- Properties of type
System.Object