EntityRepositoryDuplicateObject Method |
Duplicates the object.
Namespace:
Aloe.SystemFrameworks.Domain
Assembly:
Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntaxpublic virtual EntityObject DuplicateObject(
EntityObject obj,
ObjectTransaction transaction = null
)
Public Overridable Function DuplicateObject (
obj As EntityObject,
Optional transaction As ObjectTransaction = Nothing
) As EntityObject
public:
virtual EntityObject^ DuplicateObject(
EntityObject^ obj,
ObjectTransaction^ transaction = nullptr
)
abstract DuplicateObject :
obj : EntityObject *
?transaction : ObjectTransaction
(* Defaults:
let _transaction = defaultArg transaction null
*)
-> EntityObject
override DuplicateObject :
obj : EntityObject *
?transaction : ObjectTransaction
(* Defaults:
let _transaction = defaultArg transaction null
*)
-> EntityObject
Parameters
- obj
- Type: Aloe.SystemFrameworks.DomainEntityObject
The object. - transaction (Optional)
- Type: Aloe.SystemFrameworks.DomainObjectTransaction
Transaction
Return Value
Type:
EntityObject
Exceptions
Remarks
The base method duplicates the object, but does nothing about changing the natural key.
For example, when duplicating a product, a new product code should be provided.
Descendant methods are responsible for implementing a policy for natural key assignment.
The policy is usually to clear the natural key and allow business rules to auto-assign it.
See Also