C# 클래스 Griffin.Data.UnitOfWorkExtensions

Expose DbCommand in the UoW.
파일 보기 프로젝트 열기: jgauffin/Griffin.Framework

공개 메소드들

메소드 설명
CreateDbCommand ( this unitOfWork ) : DbCommand

Create a Dbcommand

The async methods in ADO.NET is only exposed in the ADO.NET base classes (i.e. DbCommand) and not in the interfaces. We'll therefore have to violate Liskovs Substitution Principle to be able to access them. You should however be fine if you seperate data from business and just do integration tests for your data layer.

ExecuteNonQuery ( this unitOfWork, string sql, object parameters = null ) : void

Execute a query directly

Do note that the query must be using table column names and not class properties. No mapping is being made.

null is automatically replaced by DBNull.Value for the parameters

ExecuteScalar ( this unitOfWork, string sql, object parameters = null ) : object

Execute a scalar query.

Do note that the query must be using table column names and not class properties. No mapping is being made.

null is automatically replaced by DBNull.Value for the parameters

메소드 상세

CreateDbCommand() 공개 정적인 메소드

Create a Dbcommand

The async methods in ADO.NET is only exposed in the ADO.NET base classes (i.e. DbCommand) and not in the interfaces. We'll therefore have to violate Liskovs Substitution Principle to be able to access them. You should however be fine if you seperate data from business and just do integration tests for your data layer.

public static CreateDbCommand ( this unitOfWork ) : DbCommand
unitOfWork this
리턴 System.Data.Common.DbCommand

ExecuteNonQuery() 공개 정적인 메소드

Execute a query directly

Do note that the query must be using table column names and not class properties. No mapping is being made.

null is automatically replaced by DBNull.Value for the parameters

public static ExecuteNonQuery ( this unitOfWork, string sql, object parameters = null ) : void
unitOfWork this Unit of work to execute query in
sql string sql query
parameters object parameters used in the query
리턴 void

ExecuteScalar() 공개 정적인 메소드

Execute a scalar query.

Do note that the query must be using table column names and not class properties. No mapping is being made.

null is automatically replaced by DBNull.Value for the parameters

public static ExecuteScalar ( this unitOfWork, string sql, object parameters = null ) : object
unitOfWork this Unit of work to execute query in
sql string sql query
parameters object parameters used in the query
리턴 object