C# Класс MicroLite.Mapping.PocoObjectInfo

Наследование: IObjectInfo
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
VerifyIdentifierMapped ( ) : void
VerifyInstanceIsCorrectTypeForThisObjectInfo ( object instance ) : void

Описание методов

CreateInstance() публичный Метод

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.
Результат object

GetColumnInfo() публичный Метод

Gets the column information for the column with the specified name.
public GetColumnInfo ( string columnName ) : ColumnInfo
columnName string Name of the column.
Результат ColumnInfo

GetIdentifierValue() публичный Метод

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.
Результат object

GetInsertValues() публичный Метод

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.
Результат SqlArgument[]

GetUpdateValues() публичный Метод

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.
Результат SqlArgument[]

HasDefaultIdentifierValue() публичный Метод

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.
Результат bool

IsDefaultIdentifier() публичный Метод

Determines whether the specified identifier value is the default identifier value.
public IsDefaultIdentifier ( object identifier ) : bool
identifier object The identifier value to verify.
Результат bool

PocoObjectInfo() публичный Метод

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.
Результат System

SetIdentifierValue() публичный Метод

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.
Результат void

VerifyInstanceForInsert() публичный Метод

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.
Результат void