更新日志


GZDBHelper

新增接口 IProcedure,存储过程对象

并且 IDatabase 接口中新增存储过程对象参数的调用方法

 /// <summary>
/// 执行存储过程,并返回受影响行数
/// </summary>
/// <param name="procedure"></param>
/// <returns></returns>
int ExecuteNonQuerySP(IProcedure procedure);
/// <summary>
/// 执行存储过程,返回数据集合
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="procedure"></param>
/// <param name="action"></param>
/// <returns></returns>
List<T> ExecuteDataListSP<T>(IProcedure procedure, Func<DbDataReader, T> action);
/// <summary>
/// 执行存储过程,返回数据集合
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="procedure"></param>
/// <returns></returns>
List<T> ExecuteDataListSP<T>(IProcedure procedure) where T : new();
/// <summary>
/// 执行存储过程,返回第一行数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="procedure"></param>
/// <param name="action"></param>
/// <returns></returns>
T ExecuteDataFirstSP<T>(IProcedure procedure, Func<DbDataReader, T> action);

/// <summary>
/// 执行存储过程,返回第一行数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="procedure"></param>
/// <returns></returns>
T ExecuteDataFirstSP<T>(IProcedure procedure) where T : new();

/// <summary>
/// 执行存储过程,委托处理结果
/// </summary>
/// <param name="procedure"></param>
/// <param name="action"></param>
void ExecuteDataReaderSP(IProcedure procedure, Action<DbDataReader> action);

/// <summary>
/// 执行存储过程,返回第一行第一列
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="procedure"></param>
/// <returns></returns>
T ExecuteScalarSP<T>(IProcedure procedure);

/// <summary>
/// 执行存储过程,返回DataTable结构
/// </summary>
/// <param name="procedure"></param>
/// <param name="TableName"></param>
/// <returns></returns>
DataTable GetTableSP(IProcedure procedure, string TableName);

/// <summary>
/// 执行存储过程,返回DataSet结构
/// </summary>
/// <param name="procedure"></param>
/// <returns></returns>
DataSet GetDataSetSP(IProcedure procedure);

/// <summary>
/// 执行存储过程,判断是否有返回数据
/// </summary>
/// <param name="procedure"></param>
/// <returns></returns>
bool HasRowSP(IProcedure procedure);
GarsonZhang www.yesdotnet.com

 

GZDBHelper.MSSQL

新增特性:Attributes.CommandParameterAttribute,存储过程参数特性类

负责指定存储过程参数的 数据类型(DbType),长度(Size),和参数类型 (Direction)

 

新增 SQLProcedureBase 类,继承自 GZDBHelper.IProcedure

MSSQL ( SQL Server ) 存储过程对象需要派生自 SQLProcedureBase 类,就能轻松的调用存储过程

 

 

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YES开发框架
上一篇:更新日志
下一篇:没有了
评论列表

发表评论

评论内容
昵称:
关联文章