C# Class Repository, code

Inheritance: IBoatInspectorRepository
Show file Open project: shendongnian/code Class Usage Examples

Private Properties

Property Type Description
Add RepositoryInstructionResult
Get T
MethodA void
MethodB void
Update RepositoryInstructionResult

Public Methods

Method Description
Delete ( entity ) : void

Delete an entity

Disconnect ( ISession session ) : void

Disconnect from the session. Accept parameter so we can use anywhere.

Flush ( ) : void

Method for flushing the session.

GetById ( Guid id ) : T

Retrieve an entity

Reconnect ( ISession session ) : void

Reconnect to the session. Accept parameter so we can use anywhere.

Repository ( IDatabaseSessions databaseSessions, DbConnectionSessionType connectionType = DbConnectionSessionType.PostgresqlSession )
Repository ( ISession session )
Respository ( MyDbContext db )
Save ( entity ) : void

Save an entity.

SearchExact ( string keyword, Expression getNameExpression ) : IQueryable
Update ( entity ) : void

Update an entity

Private Methods

Method Description
Add ( item ) : RepositoryInstructionResult
Get ( int id ) : T
MethodA ( ) : void
MethodB ( ) : void
Update ( item ) : RepositoryInstructionResult

Method Details

Delete() public method

Delete an entity
public Delete ( entity ) : void
return void

Disconnect() public method

Disconnect from the session. Accept parameter so we can use anywhere.
public Disconnect ( ISession session ) : void
session ISession
return void

Flush() public method

Method for flushing the session.
public Flush ( ) : void
return void

GetById() public method

Retrieve an entity
public GetById ( Guid id ) : T
id Guid
return T

Reconnect() public method

Reconnect to the session. Accept parameter so we can use anywhere.
public Reconnect ( ISession session ) : void
session ISession
return void

Repository() public method

public Repository ( IDatabaseSessions databaseSessions, DbConnectionSessionType connectionType = DbConnectionSessionType.PostgresqlSession )
databaseSessions IDatabaseSessions
connectionType DbConnectionSessionType

Repository() public method

public Repository ( ISession session )
session ISession

Respository() public method

public Respository ( MyDbContext db )
db MyDbContext

Save() public method

Save an entity.
public Save ( entity ) : void
return void

SearchExact() public method

public SearchExact ( string keyword, Expression getNameExpression ) : IQueryable
keyword string
getNameExpression Expression
return IQueryable

Update() public method

Update an entity
public Update ( entity ) : void
return void