Click or drag to resize

ExtensionsCloningMapToT Method (Object)

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 T MapTo<T>(
	this Object source
)
where T : class, new()

Parameters

source
Type: SystemObject
The source object

Type Parameters

T
The Type of the target instance

Return Value

Type: T
Returns the target

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. 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
See Also