Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ReflectionUtils.MemberwiseCopy Method

Copies all fields from one object to another.

[Visual Basic]
Public Shared Sub MemberwiseCopy( _
   ByVal fromObject As Object, _
   ByVal toObject As Object _
)
[C#]
public static void MemberwiseCopy(
   object fromObject,
   object toObject
);

Parameters

fromObject
The source object
toObject
The object, who's fields will be populated with values from the source object

Remarks

The types of both objects must be related. This means, that either of the following is true:

Exceptions

Exception Type Condition
ArgumentException If the object's types are not related

See Also

ReflectionUtils Class | Spring.Util Namespace