/// <summary> /// 执行存储过程,返回int /// </summary> /// <param name="param">ParamSP</param> /// <returns>int</returns> public int SP(ParamSP param) { var result = 0; result = BuilderParse(param).Execute(); return(result); }
/// <summary> /// 执行存储过程,返回CommandResult对象 /// </summary> /// <param name="param">ParamSP</param> /// <returns>CommandResult</returns> public CommandResult PCmdResult(ParamSP param) { CommandResult result = null; result = BuilderParse(param).QuerySingle <CommandResult>(); return(result); }
protected IStoredProcedureBuilder BuilderParse(ParamSP param) { var data = param.GetData(); var spBuilder = db.StoredProcedure(data.Name); foreach (var item in data.Parameter) { spBuilder.Parameter(item.Key, item.Value); } foreach (var item in data.ParameterOut) { spBuilder.ParameterOut(item.Key, item.Value); } return(spBuilder); }
/// <summary> /// 分页获取动态数据列表。 /// </summary> /// <param name="param">ParamSP存储过程参数对象</param> /// <returns>dynamic</returns> public dynamic GetDynamicPageList(ParamSP param = null) { var result = BuilderParse(param).QueryMany <dynamic>(); return(result); }