@@ -424,10 +424,12 @@ public virtual string ToCountStatement(Type fromTableType, string sqlFilter, par
424
424
! string . IsNullOrEmpty ( sqlFilter )
425
425
&& sqlFilter . TrimStart ( ) . StartsWith ( SelectStatement , StringComparison . OrdinalIgnoreCase ) ;
426
426
427
- if ( isFullSelectStatement ) return ( filterParams != null ? sqlFilter . SqlFmt ( filterParams ) : sqlFilter ) ;
427
+ if ( isFullSelectStatement )
428
+ return ( filterParams != null ? sqlFilter . SqlFmt ( filterParams ) : sqlFilter ) ;
428
429
429
430
sql . AppendFormat ( "SELECT {0} FROM {1}" , "COUNT(*)" ,
430
431
GetQuotedTableName ( modelDef ) ) ;
432
+
431
433
if ( ! string . IsNullOrEmpty ( sqlFilter ) )
432
434
{
433
435
sqlFilter = filterParams != null ? sqlFilter . SqlFmt ( filterParams ) : sqlFilter ;
@@ -487,10 +489,9 @@ public virtual string GetColumnNames(ModelDefinition modelDef)
487
489
if ( sqlColumns . Length > 0 )
488
490
sqlColumns . Append ( ", " ) ;
489
491
490
- if ( field . IsRowVersion )
491
- sqlColumns . Append ( GetRowVersionColumnName ( field ) ) ;
492
- else
493
- sqlColumns . Append ( GetQuotedColumnName ( field . FieldName ) ) ;
492
+ sqlColumns . Append ( field . IsRowVersion
493
+ ? GetRowVersionColumnName ( field )
494
+ : GetQuotedColumnName ( field . FieldName ) ) ;
494
495
}
495
496
496
497
return sqlColumns . ToString ( ) ;
@@ -508,7 +509,7 @@ public virtual string ToInsertRowStatement(IDbCommand command, object objWithPro
508
509
509
510
foreach ( var fieldDef in modelDef . FieldDefinitions )
510
511
{
511
- if ( fieldDef . AutoIncrement || fieldDef . IsComputed || fieldDef . IsRowVersion )
512
+ if ( fieldDef . ShouldSkipInsert ( ) )
512
513
continue ;
513
514
514
515
//insertFields contains Property "Name" of fields to insert ( that's how expressions work )
@@ -547,7 +548,7 @@ public virtual void PrepareParameterizedInsertStatement<T>(IDbCommand cmd, IColl
547
548
548
549
foreach ( var fieldDef in modelDef . FieldDefinitionsArray )
549
550
{
550
- if ( fieldDef . AutoIncrement || fieldDef . IsComputed || fieldDef . IsRowVersion )
551
+ if ( fieldDef . ShouldSkipInsert ( ) )
551
552
continue ;
552
553
553
554
//insertFields contains Property "Name" of fields to insert ( that's how expressions work )
@@ -590,7 +591,7 @@ public virtual bool PrepareParameterizedUpdateStatement<T>(IDbCommand cmd, IColl
590
591
591
592
foreach ( var fieldDef in modelDef . FieldDefinitions )
592
593
{
593
- if ( fieldDef . IsComputed )
594
+ if ( fieldDef . ShouldSkipUpdate ( ) )
594
595
continue ;
595
596
596
597
try
@@ -660,7 +661,7 @@ public virtual bool PrepareParameterizedDeleteStatement<T>(IDbCommand cmd, IColl
660
661
661
662
foreach ( var fieldDef in modelDef . FieldDefinitions )
662
663
{
663
- if ( fieldDef . IsComputed )
664
+ if ( fieldDef . ShouldSkipDelete ( ) )
664
665
continue ;
665
666
666
667
if ( ! fieldDef . IsRowVersion && ( hasSpecificFilter && ! deleteFields . Contains ( fieldDef . Name ) ) )
@@ -814,7 +815,8 @@ public virtual string ToUpdateRowStatement(object objWithProperties, ICollection
814
815
815
816
foreach ( var fieldDef in modelDef . FieldDefinitions )
816
817
{
817
- if ( fieldDef . IsComputed ) continue ;
818
+ if ( fieldDef . ShouldSkipUpdate ( ) )
819
+ continue ;
818
820
819
821
try
820
822
{
@@ -856,6 +858,9 @@ public virtual string ToDeleteRowStatement(object objWithProperties)
856
858
857
859
foreach ( var fieldDef in modelDef . FieldDefinitions )
858
860
{
861
+ if ( fieldDef . ShouldSkipDelete ( ) )
862
+ continue ;
863
+
859
864
try
860
865
{
861
866
if ( fieldDef . IsPrimaryKey )
0 commit comments