FengYun.NPoco.Data by zhaixd

<PackageReference Include="FengYun.NPoco.Data" Version="1.1.0" />

 DbSession

仓储实现 author:zhaixd date:2016.08.12
public INPocoDataBase DbContext { get; }

public DbSession(INPocoDataBase dataBase)

默认构造

public int Delete(object model)

public int Delete<TEntity>(object PrimaryKey)

public int ExcuteNoQuery(string sql, object[] parameters)

public int ExcuteNoQuery(Sql sql)

public DataTable ExcuteQuery(string sql, object[] parameters)

public DataTable ExcuteQuery(Sql sql)

public T ExcuteScalar<T>(string sql, object[] parameters)

public T ExcuteScalar<T>(Sql sql)

public void ExecuteStoredProcedure(string procedureName, StoreParameter[] parameters)

public TEntity First<TEntity>(string sql, object[] keys)

通过指定条件获取第一个实体

public TEntity First<TEntity>(SearchSqlBuilder search)

通过指定条件获取第一个实体

public object Insert<TEntity>(TEntity Model)

public IEnumerable<TEntity> Query<TEntity>(string sql, object[] args)

查询数据列表

public IEnumerable<TEntity> Query<TEntity>(SearchSqlBuilder search)

查询数据列表

public Page<TEntity> QueryPage<TEntity>(int pageIndex, int pageSize, string sql, object[] args)

分页查询列表

public Page<TEntity> QueryPage<TEntity>(SearchSqlBuilder search)

分页查询列表

public DataTable QueryStoredProcedure(string procedureName, StoreParameter[] parameters)

public IEnumerable<T> QueryStoredProcedure<T>(string procedureName, StoreParameter[] parameters)

public TEntity Single<TEntity>(string sql, object[] keys)

通过指定条件获取单一实体 多于一条则报错,不确定有且仅有一条时请使用 First

public TEntity Single<TEntity>(SearchSqlBuilder search)

通过指定条件获取单一实体 多于一条则报错,不确定有且仅有一条时请使用 First

public TEntity SingleById<TEntity>(object primaryKey)

获取指定主键值得实体

public T SingleStoredProcedure<T>(string procedureName, StoreParameter[] parameters)

public int Update(object model)