C# Class Summer.Batch.Common.Util.CopyUtils

Copy Helper.
Datei anzeigen Open project: SummerBatch/SummerBatch

Public Methods

Method Description
CopyProperties ( object destination, object origin ) : void

Copy properties from an origin object to a destination object. A property is copied if : - the property names are the same in both destination and origin object. A property is skipped if : - a property exists in the origin object but do not exist in the destination object. - a property is not readable in the origin object. - a property is not writable in the destination object. - the destination property type is not assignable from the origin property type.

Private Methods

Method Description
CheckCompatibility ( PropertyInfo piDestination, PropertyInfo piOrigin ) : bool

Checks compatibility between origin and destination.

CheckDestinationNullity ( PropertyInfo piDestination, PropertyInfo piOrigin ) : bool

Checks that destination is not null.

CheckDestinationWritability ( PropertyInfo piDestination, PropertyInfo piOrigin ) : bool

Checks that destination can be written to.

CheckOriginReadability ( PropertyInfo piOrigin ) : bool

Checks that origin can be read.

Method Details

CopyProperties() public static method

Copy properties from an origin object to a destination object. A property is copied if : - the property names are the same in both destination and origin object. A property is skipped if : - a property exists in the origin object but do not exist in the destination object. - a property is not readable in the origin object. - a property is not writable in the destination object. - the destination property type is not assignable from the origin property type.
 
public static CopyProperties ( object destination, object origin ) : void
destination object
origin object
return void