Click or drag to resize

ExtensionsCloningMapToT, TTarget Method (T, TTarget)

Note: This API is now obsolete.

Maps all properties and fields of an instance to another instance. The Clone() method is used to copy an instance if exist.

Mapping fails on jagged and multidimensional array. Classes without parameterless constructor will stay null.

Namespace:  Cauldron.Activator
Assembly:  Cauldron.Activator (in Cauldron.Activator.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
[ObsoleteAttribute("Use Mapster instead")]
public static TTarget MapTo<T, TTarget>(
	this T source,
	TTarget target
)

Parameters

source
Type: T
The source object
target
Type: TTarget
The target object

Type Parameters

T
The Type of the source instance
TTarget
The Type of the target instance

Return Value

Type: TTarget
Returns the target

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionsource is null
ArgumentNullExceptiontarget is null
See Also