@@ -115,15 +115,14 @@ DELETE FROM {tablePrefix}_effects
115
115
}
116
116
117
117
private string ? _createFunctionSql ;
118
- public string CreateFunction (
118
+ public StoreCommand CreateFunction (
119
119
StoredId storedId ,
120
120
FlowInstance humanInstanceId ,
121
121
byte [ ] ? param ,
122
122
long leaseExpiration ,
123
123
long ? postponeUntil ,
124
124
long timestamp ,
125
125
StoredId ? parent ,
126
- SqlCommand command ,
127
126
string ? paramPrefix )
128
127
{
129
128
_createFunctionSql ??= @$ "
@@ -153,16 +152,17 @@ public string CreateFunction(
153
152
if ( paramPrefix != null )
154
153
sql = sql . Replace ( "@" , $ "@{ paramPrefix } ") ;
155
154
156
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } FlowType", storedId . Type . Value ) ;
157
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } FlowInstance", storedId . Instance . Value ) ;
158
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } Status", ( int ) ( postponeUntil == null ? Status . Executing : Status . Postponed ) ) ;
159
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } ParamJson", param == null ? SqlBinary . Null : param ) ;
160
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } Expires", postponeUntil ?? leaseExpiration ) ;
161
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } HumanInstanceId", humanInstanceId . Value ) ;
162
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } Timestamp", timestamp ) ;
163
- command . Parameters . AddWithValue ( $ "@{ paramPrefix } Parent", parent ? . Serialize ( ) ?? ( object ) DBNull . Value ) ;
155
+ var command = new StoreCommand ( sql ) ;
156
+ command . AddParameter ( $ "@{ paramPrefix } FlowType", storedId . Type . Value ) ;
157
+ command . AddParameter ( $ "@{ paramPrefix } FlowInstance", storedId . Instance . Value ) ;
158
+ command . AddParameter ( $ "@{ paramPrefix } Status", ( int ) ( postponeUntil == null ? Status . Executing : Status . Postponed ) ) ;
159
+ command . AddParameter ( $ "@{ paramPrefix } ParamJson", param == null ? SqlBinary . Null : param ) ;
160
+ command . AddParameter ( $ "@{ paramPrefix } Expires", postponeUntil ?? leaseExpiration ) ;
161
+ command . AddParameter ( $ "@{ paramPrefix } HumanInstanceId", humanInstanceId . Value ) ;
162
+ command . AddParameter ( $ "@{ paramPrefix } Timestamp", timestamp ) ;
163
+ command . AddParameter ( $ "@{ paramPrefix } Parent", parent ? . Serialize ( ) ?? ( object ) DBNull . Value ) ;
164
164
165
- return sql ;
165
+ return command ;
166
166
}
167
167
168
168
private string ? _succeedFunctionSql ;
0 commit comments