@@ -14,15 +14,16 @@ public MethodDeclaration OneDeclare(string funcName, string queryTextConstant, s
14
14
IEnumerable < IComposable > withResourceBody = new List < IComposable > ( ) ;
15
15
var queryParams = GetQueryParams ( argInterface , parameters ) ;
16
16
withResourceBody = withResourceBody . AppendIfNotNull ( queryParams ) ;
17
- withResourceBody = withResourceBody . Concat (
18
- [
19
- dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
20
- ExecuteAndAssign ( funcName , queryParams ) ,
21
- new SimpleStatement ( Variable . Row . AsVar ( ) , new SimpleExpression ( $ "{ Variable . Result . AsVar ( ) } .first") ) ,
22
- new SimpleExpression ( $ "return nil if { Variable . Row . AsVar ( ) } .nil?") ,
23
- new SimpleStatement ( $ "{ Variable . Entity . AsVar ( ) } ", newObjectExpression ) ,
24
- new SimpleExpression ( $ "return { Variable . Entity . AsVar ( ) } ")
25
- ]
17
+ withResourceBody = withResourceBody
18
+ . Concat (
19
+ [
20
+ dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
21
+ ExecuteAndAssign ( funcName , queryParams ) ,
22
+ new SimpleStatement ( Variable . Row . AsVar ( ) , new SimpleExpression ( $ "{ Variable . Result . AsVar ( ) } .first") ) ,
23
+ new SimpleExpression ( $ "return nil if { Variable . Row . AsVar ( ) } .nil?") ,
24
+ new SimpleStatement ( $ "{ Variable . Entity . AsVar ( ) } ", newObjectExpression ) ,
25
+ new SimpleExpression ( $ "return { Variable . Entity . AsVar ( ) } ")
26
+ ]
26
27
) ;
27
28
28
29
return new MethodDeclaration ( funcName , GetMethodArgs ( argInterface , parameters ) ,
@@ -45,14 +46,15 @@ public MethodDeclaration ManyDeclare(string funcName, string queryTextConstant,
45
46
IEnumerable < IComposable > withResourceBody = new List < IComposable > ( ) ;
46
47
var queryParams = GetQueryParams ( argInterface , parameters ) ;
47
48
withResourceBody = withResourceBody . AppendIfNotNull ( queryParams ) ;
48
- withResourceBody = withResourceBody . Concat (
49
- [
50
- dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
51
- ExecuteAndAssign ( funcName , queryParams ) ,
52
- new SimpleStatement ( Variable . Entities . AsVar ( ) , new SimpleExpression ( "[]" ) ) ,
53
- new ForeachLoop ( Variable . Result . AsVar ( ) , Variable . Row . AsVar ( ) , new List < IComposable > { listAppend } ) ,
54
- new SimpleExpression ( $ "return { Variable . Entities . AsVar ( ) } ")
55
- ]
49
+ withResourceBody = withResourceBody
50
+ . Concat (
51
+ [
52
+ dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
53
+ ExecuteAndAssign ( funcName , queryParams ) ,
54
+ new SimpleStatement ( Variable . Entities . AsVar ( ) , new SimpleExpression ( "[]" ) ) ,
55
+ new ForeachLoop ( Variable . Result . AsVar ( ) , Variable . Row . AsVar ( ) , new List < IComposable > { listAppend } ) ,
56
+ new SimpleExpression ( $ "return { Variable . Entities . AsVar ( ) } ")
57
+ ]
56
58
) ;
57
59
58
60
return new MethodDeclaration ( funcName , GetMethodArgs ( argInterface , parameters ) ,
@@ -68,12 +70,10 @@ public MethodDeclaration ExecDeclare(string funcName, string queryTextConstant,
68
70
IEnumerable < IComposable > withResourceBody = new List < IComposable > ( ) ;
69
71
var queryParams = GetQueryParams ( argInterface , parameters ) ;
70
72
withResourceBody = withResourceBody . AppendIfNotNull ( queryParams ) ;
71
- withResourceBody = withResourceBody . Concat (
72
- [
73
- dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
74
- dbDriver . ExecuteStmt ( funcName , queryParams )
75
- ]
76
- ) ;
73
+ withResourceBody = withResourceBody
74
+ . Append ( dbDriver . PrepareStmt ( funcName , queryTextConstant ) )
75
+ . Append ( dbDriver . ExecuteStmt ( funcName , queryParams ) ) ;
76
+
77
77
return new MethodDeclaration ( funcName , GetMethodArgs ( argInterface , parameters ) ,
78
78
new List < IComposable >
79
79
{
@@ -87,13 +87,14 @@ public MethodDeclaration ExecLastIdDeclare(string funcName, string queryTextCons
87
87
IEnumerable < IComposable > withResourceBody = new List < IComposable > ( ) ;
88
88
var queryParams = GetQueryParams ( argInterface , parameters ) ;
89
89
withResourceBody = withResourceBody . AppendIfNotNull ( queryParams ) ;
90
- withResourceBody = withResourceBody . Concat (
91
- [
92
- dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
93
- dbDriver . ExecuteStmt ( funcName , queryParams ) ,
94
- new SimpleExpression ( $ "return { Variable . Client . AsVar ( ) } .last_id")
95
- ]
96
- ) ;
90
+ withResourceBody = withResourceBody
91
+ . Concat (
92
+ [
93
+ dbDriver . PrepareStmt ( funcName , queryTextConstant ) ,
94
+ dbDriver . ExecuteStmt ( funcName , queryParams ) ,
95
+ new SimpleExpression ( $ "return { Variable . Client . AsVar ( ) } .last_id")
96
+ ]
97
+ ) ;
97
98
return new MethodDeclaration ( funcName , GetMethodArgs ( argInterface , parameters ) ,
98
99
new List < IComposable >
99
100
{
0 commit comments