@@ -467,15 +467,11 @@ public virtual string ToSelectStatement(Type tableType, string sqlFilter, params
467
467
return sql . ToString ( ) ;
468
468
}
469
469
470
- public virtual string ToInsertRowStatement ( object objWithProperties , IDbCommand command )
471
- {
472
- return ToInsertRowStatement ( objWithProperties , new List < string > ( ) , command ) ;
473
- }
474
-
475
- public virtual string ToInsertRowStatement ( object objWithProperties , IList < string > insertFields , IDbCommand command )
470
+ public virtual string ToInsertRowStatement ( IDbCommand command , object objWithProperties , ICollection < string > insertFields = null )
476
471
{
472
+ if ( insertFields == null )
473
+ insertFields = new List < string > ( ) ;
477
474
478
- if ( insertFields == null ) insertFields = new List < string > ( ) ;
479
475
var sbColumnNames = new StringBuilder ( ) ;
480
476
var sbColumnValues = new StringBuilder ( ) ;
481
477
var modelDef = objWithProperties . GetType ( ) . GetModelDefinition ( ) ;
@@ -508,14 +504,11 @@ public virtual string ToInsertRowStatement(object objWithProperties, IList<strin
508
504
return sql ;
509
505
}
510
506
511
- public virtual IDbCommand CreateParameterizedInsertStatement ( object objWithProperties , IDbConnection connection )
507
+ public virtual IDbCommand CreateParameterizedInsertStatement ( IDbConnection connection , object objWithProperties , ICollection < string > insertFields = null )
512
508
{
513
- return CreateParameterizedInsertStatement ( objWithProperties , null , connection ) ;
514
- }
509
+ if ( insertFields == null )
510
+ insertFields = new List < string > ( ) ;
515
511
516
- public virtual IDbCommand CreateParameterizedInsertStatement ( object objWithProperties , IList < string > insertFields , IDbConnection connection )
517
- {
518
- if ( insertFields == null ) insertFields = new List < string > ( ) ;
519
512
var sbColumnNames = new StringBuilder ( ) ;
520
513
var sbColumnValues = new StringBuilder ( ) ;
521
514
var modelDef = objWithProperties . GetType ( ) . GetModelDefinition ( ) ;
@@ -554,16 +547,13 @@ public virtual IDbCommand CreateParameterizedInsertStatement(object objWithPrope
554
547
return command ;
555
548
}
556
549
557
- public void ReParameterizeInsertStatement ( object objWithProperties , IDbCommand command )
550
+ public void ReParameterizeInsertStatement ( IDbCommand command , object objWithProperties , ICollection < string > insertFields = null )
558
551
{
559
- ReParameterizeInsertStatement ( objWithProperties , null , command ) ;
560
- }
552
+ if ( insertFields == null )
553
+ insertFields = new List < string > ( ) ;
561
554
562
- public void ReParameterizeInsertStatement ( object objWithProperties , IList < string > insertFields , IDbCommand command )
563
- {
564
- if ( insertFields == null ) insertFields = new List < string > ( ) ;
565
555
var modelDef = objWithProperties . GetType ( ) . GetModelDefinition ( ) ;
566
-
556
+
567
557
command . Parameters . Clear ( ) ;
568
558
569
559
foreach ( var fieldDef in modelDef . FieldDefinitions )
@@ -617,14 +607,11 @@ private object GetValueOrDbNull(String value)
617
607
return value ;
618
608
}
619
609
620
- public virtual string ToUpdateRowStatement ( object objWithProperties )
610
+ public virtual string ToUpdateRowStatement ( object objWithProperties , ICollection < string > updateFields = null )
621
611
{
622
- return ToUpdateRowStatement ( objWithProperties , new List < string > ( ) ) ;
623
- }
612
+ if ( updateFields == null )
613
+ updateFields = new List < string > ( ) ;
624
614
625
- public virtual string ToUpdateRowStatement ( object objWithProperties , IList < string > updateFields )
626
- {
627
- if ( updateFields == null ) updateFields = new List < string > ( ) ;
628
615
var sqlFilter = new StringBuilder ( ) ;
629
616
var sql = new StringBuilder ( ) ;
630
617
var modelDef = objWithProperties . GetType ( ) . GetModelDefinition ( ) ;
@@ -663,14 +650,11 @@ public virtual string ToUpdateRowStatement(object objWithProperties, IList<strin
663
650
return updateSql ;
664
651
}
665
652
666
- public virtual IDbCommand CreateParameterizedUpdateStatement ( object objWithProperties , IDbConnection connection )
653
+ public virtual IDbCommand CreateParameterizedUpdateStatement ( IDbConnection connection , object objWithProperties , ICollection < string > updateFields = null )
667
654
{
668
- return CreateParameterizedUpdateStatement ( objWithProperties , null , connection ) ;
669
- }
655
+ if ( updateFields == null )
656
+ updateFields = new List < string > ( ) ;
670
657
671
- public virtual IDbCommand CreateParameterizedUpdateStatement ( object objWithProperties , IList < string > updateFields , IDbConnection connection )
672
- {
673
- if ( updateFields == null ) updateFields = new List < string > ( ) ;
674
658
var sqlFilter = new StringBuilder ( ) ;
675
659
var sql = new StringBuilder ( ) ;
676
660
var modelDef = objWithProperties . GetType ( ) . GetModelDefinition ( ) ;
@@ -952,7 +936,7 @@ public virtual SqlExpressionVisitor<T> ExpressionVisitor<T>()
952
936
throw new NotImplementedException ( ) ;
953
937
}
954
938
955
- public IDbCommand CreateParameterizedDeleteStatement ( object objWithProperties , IDbConnection connection )
939
+ public IDbCommand CreateParameterizedDeleteStatement ( IDbConnection connection , object objWithProperties )
956
940
{
957
941
throw new NotImplementedException ( ) ;
958
942
}
0 commit comments