@@ -41,7 +41,7 @@ public DataConnection(string dbMappingName)
4141 this . CustomerExecuteQuery = DalBridge . CustomerExecuteQuery ;
4242 this . CustomerExecuteQueryTable = DalBridge . CustomerExecuteQueryTable ;
4343 this . CustomerBeginTransaction = DalBridge . CustomerBeginTransaction ;
44-
44+ this . CreateDbDataParameter = DalBridge . CreateDbDataParameter ;
4545 #endregion
4646 }
4747
@@ -63,7 +63,8 @@ public DataConnection([JetBrains.Annotations.NotNull] IDataProvider dataProvider
6363 this . CustomerExecuteScalar = DalBridge . CustomerExecuteScalar ;
6464 this . CustomerExecuteQuery = DalBridge . CustomerExecuteQuery ;
6565 this . CustomerExecuteQueryTable = DalBridge . CustomerExecuteQueryTable ;
66- this . CustomerBeginTransaction = DalBridge . CustomerBeginTransaction ;
66+ this . CustomerBeginTransaction = DalBridge . CustomerBeginTransaction ;
67+ this . CreateDbDataParameter = DalBridge . CreateDbDataParameter ;
6768 #endregion
6869 }
6970
@@ -78,7 +79,7 @@ public DataConnection([JetBrains.Annotations.NotNull] IDataProvider dataProvider
7879 /// <param name="CustomerExecuteQuery">执行select 序列化成对象 </param>
7980 /// <param name="CustomerExecuteQueryTable">执行select 不走序列化 生成DataTable</param>
8081 /// <param name="CustomerBeginTransaction">执行事物</param>
81- public DataConnection ( [ JetBrains . Annotations . NotNull ] IDataProvider dataProvider , string dbMappingName , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , int > CustomerExecuteNonQuery , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , object > CustomerExecuteScalar , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , List < IDataReader > > CustomerExecuteQuery , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , DataTable > CustomerExecuteQueryTable , Func < string , IDictionary , DataConnectionTransaction > CustomerBeginTransaction )
82+ public DataConnection ( [ JetBrains . Annotations . NotNull ] IDataProvider dataProvider , string dbMappingName , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , int > CustomerExecuteNonQuery , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , object > CustomerExecuteScalar , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , List < IDataReader > > CustomerExecuteQuery , Func < string , string , Dictionary < string , CustomerParam > , IDictionary , bool , DataTable > CustomerExecuteQueryTable , Func < string , IDictionary , DataConnectionTransaction > CustomerBeginTransaction , Func < string , IDictionary , IDbDataParameter > CreateDbDataParameter )
8283 {
8384 if ( dataProvider == null ) throw new ArgumentNullException ( "dataProvider" ) ;
8485
@@ -92,6 +93,7 @@ public DataConnection([JetBrains.Annotations.NotNull] IDataProvider dataProvider
9293 this . CustomerExecuteQuery = CustomerExecuteQuery ;
9394 this . CustomerExecuteQueryTable = CustomerExecuteQueryTable ;
9495 this . CustomerBeginTransaction = CustomerBeginTransaction ;
96+ this . CreateDbDataParameter = CreateDbDataParameter ;
9597 }
9698 #endregion
9799
@@ -184,6 +186,7 @@ internal bool IsMarsEnabled
184186 /// 事物
185187 /// </summary>
186188 private Func < string , IDictionary , DataConnectionTransaction > CustomerBeginTransaction { get ; set ; }
189+ private Func < string , IDictionary , IDbDataParameter > CreateDbDataParameter { get ; set ; }
187190
188191
189192 #endregion
@@ -473,6 +476,21 @@ internal DataConnectionTransaction ExecuteTransaction(IsolationLevel isolationLe
473476 ConnectionWrapper = result . DataConnection ;
474477 return result ;
475478 }
479+
480+ /// <summary>
481+ /// 获取IDbDataParameter
482+ /// </summary>
483+ /// <returns></returns>
484+ internal IDbDataParameter CreateParameter ( )
485+ {
486+ var dic = new Dictionary < string , object > ( ) ;
487+
488+ dic . Add ( DALExtStatementConstant . PARAMETER_SYMBOL , DataProvider . ParameterSymbol ) ;
489+ dic . Add ( DALExtStatementConstant . TRANSACTION_CONNECTION , ConnectionWrapper ) ;
490+ var result = CreateDbDataParameter ( ConnectionString , dic ) ;
491+ return result ;
492+
493+ }
476494 #endregion
477495
478496
0 commit comments