Visual Basic (Declaration) | |
---|---|
Public Overridable Function CloneCore() As EntityAspect |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As EntityAspect Dim value As EntityAspect value = instance.CloneCore() |
C# | |
---|---|
public virtual EntityAspect CloneCore() |
C++/CLI | |
---|---|
public: virtual EntityAspect^ CloneCore(); |
Beware: the result of CloneCore is not attached to any EntityManager even though the value of its EntityState indicates that it is! CloneCore should be called only within a Clone() method that understands this and that will ultimately expose the cloned entity as a properly formed entity with a correct EntityState.
The source EntityState is preserved so that the calling Clone() method can know and make use of the source entity’s EntityState. It is critical that the calling Clone() method return a properly formed Entity which means that, unless the method attaches the clone to a different EntityManager, the returned clone’s EntityState should be reset to "Detached".
CloneCore is called within other DevForce Clone() methods (EntityGroup.Clone for example). You can invoke it yourself by casting the entity as System.ICloneable and calling Clone() as in (Foo) ((ICloneable) foo).Clone())
. The resulting clone does not belong to an EntityManager and its EntityState is "Detached".
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family