C# Class MicroLite.Mapping.PocoObjectInfo

Inheritance: IObjectInfo
Show file Open project: TrevorPilley/MicroLite Class Usage Examples

Public Methods

Method Description
CreateInstance ( IDataReader reader ) : object

Creates a new instance of the type populated with the values from the specified IDataReader.

GetColumnInfo ( string columnName ) : ColumnInfo

Gets the column information for the column with the specified name.

GetIdentifierValue ( object instance ) : object

Gets the property value for the object identifier.

GetInsertValues ( object instance ) : SqlArgument[]

Gets the insert values for the specified instance.

GetUpdateValues ( object instance ) : SqlArgument[]

Gets the update values for the specified instance.

HasDefaultIdentifierValue ( object instance ) : bool

Determines whether the specified instance has the default identifier value.

IsDefaultIdentifier ( object identifier ) : bool

Determines whether the specified identifier value is the default identifier value.

PocoObjectInfo ( Type forType, TableInfo tableInfo ) : System

Initialises a new instance of the PocoObjectInfo class.

SetIdentifierValue ( object instance, object identifier ) : void

Sets the property value for the object identifier to the supplied value.

VerifyInstanceForInsert ( object instance ) : void

Verifies the instance can be inserted.

Private Methods

Method Description
VerifyIdentifierMapped ( ) : void
VerifyInstanceIsCorrectTypeForThisObjectInfo ( object instance ) : void

Method Details

CreateInstance() public method

Creates a new instance of the type populated with the values from the specified IDataReader.
Thrown if reader is null.
public CreateInstance ( IDataReader reader ) : object
reader IDataReader The IDataReader containing the values to build the instance from.
return object

GetColumnInfo() public method

Gets the column information for the column with the specified name.
public GetColumnInfo ( string columnName ) : ColumnInfo
columnName string Name of the column.
return ColumnInfo

GetIdentifierValue() public method

Gets the property value for the object identifier.
Thrown if instance is null. Thrown if the instance is not of the correct type.
public GetIdentifierValue ( object instance ) : object
instance object The instance to retrieve the value from.
return object

GetInsertValues() public method

Gets the insert values for the specified instance.
Thrown if instance is null. Thrown if the instance is not of the correct type.
public GetInsertValues ( object instance ) : SqlArgument[]
instance object The instance to retrieve the values from.
return SqlArgument[]

GetUpdateValues() public method

Gets the update values for the specified instance.
Thrown if instance is null. Thrown if the instance is not of the correct type.
public GetUpdateValues ( object instance ) : SqlArgument[]
instance object The instance to retrieve the values from.
return SqlArgument[]

HasDefaultIdentifierValue() public method

Determines whether the specified instance has the default identifier value.
Thrown if instance is null. Thrown if the instance is not of the correct type.
public HasDefaultIdentifierValue ( object instance ) : bool
instance object The instance to verify.
return bool

IsDefaultIdentifier() public method

Determines whether the specified identifier value is the default identifier value.
public IsDefaultIdentifier ( object identifier ) : bool
identifier object The identifier value to verify.
return bool

PocoObjectInfo() public method

Initialises a new instance of the PocoObjectInfo class.
/// Thrown if forType or tableInfo are null. ///
public PocoObjectInfo ( Type forType, TableInfo tableInfo ) : System
forType System.Type The type the object info relates to.
tableInfo TableInfo The table info.
return System

SetIdentifierValue() public method

Sets the property value for the object identifier to the supplied value.
Thrown if instance is null. Thrown if the instance is not of the correct type.
public SetIdentifierValue ( object instance, object identifier ) : void
instance object The instance to set the value for.
identifier object The value to set as the identifier property.
return void

VerifyInstanceForInsert() public method

Verifies the instance can be inserted.
Thrown if instance is null. /// Thrown if the instance is not of the correct type or its state is invalid for the specified StatementType. ///
public VerifyInstanceForInsert ( object instance ) : void
instance object The instance to verify.
return void