C# Class MicroLite.Listeners.IdentifierStrategyListener

The implementation of IInsertListener for setting the instance identifier value if IdentifierStrategy.DbGenerated or IdentifierStrategy.Sequence is used.
Inheritance: IInsertListener
ファイルを表示 Open project: TrevorPilley/MicroLite Class Usage Examples

Public Methods

Method Description
AfterInsert ( object instance, object executeScalarResult ) : void

Invoked after the SqlQuery to insert the record for the instance has been executed.

BeforeInsert ( object instance ) : void

Invoked before the SqlQuery to insert the record into the database is created.

Method Details

AfterInsert() public method

Invoked after the SqlQuery to insert the record for the instance has been executed.
Thrown if instance is null or IdentifierStrategy is DbGenerated /// and executeScalarResult is null.
public AfterInsert ( object instance, object executeScalarResult ) : void
instance object The instance which has been inserted.
executeScalarResult object The execute scalar result (the identifier value returned by the database /// or null if the identifier is .Assigned.
return void

BeforeInsert() public method

Invoked before the SqlQuery to insert the record into the database is created.
public BeforeInsert ( object instance ) : void
instance object The instance to be inserted.
return void