Click or drag to resize

CopyContextCloneIfNotMappedT Method

Looks for a mapping for this object that was added with AddObjectMappingT(T, T). If one is found, the object to which the specified one is mapped is returned. If one is not found, this method clones the given object by calling CloneT(T). Derived classes can override this default behavior.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.1.418.0 (24.1.418.0)
public virtual T CloneIfNotMapped<T>(
	T oldObject
where T : class


Type: T
The old object reference for which to look for a mapping or clone.

Type Parameters

The type of the object to clone.

Return Value

Type: T
The object that the specified object is mapped to, or a cloned object if the specified object was not mapped.
InvalidOperationException The object does not implement ICloneWithContext or ICloneable.
See Also