@@ -76,6 +76,16 @@ public override void OnAfterInitColumnTypeMap()
76
76
77
77
DbTypeMap . Set < bool > ( DbType . Int16 , BoolColumnDefinition ) ;
78
78
DbTypeMap . Set < bool ? > ( DbType . Int16 , BoolColumnDefinition ) ;
79
+
80
+ DbTypeMap . Set < sbyte > ( DbType . Int16 , IntColumnDefinition ) ;
81
+ DbTypeMap . Set < sbyte ? > ( DbType . Int16 , IntColumnDefinition ) ;
82
+ DbTypeMap . Set < ushort > ( DbType . Int32 , IntColumnDefinition ) ;
83
+ DbTypeMap . Set < ushort ? > ( DbType . Int32 , IntColumnDefinition ) ;
84
+ DbTypeMap . Set < uint > ( DbType . Int64 , LongColumnDefinition ) ;
85
+ DbTypeMap . Set < uint ? > ( DbType . Int64 , LongColumnDefinition ) ;
86
+ DbTypeMap . Set < ulong > ( DbType . Int64 , LongColumnDefinition ) ;
87
+ DbTypeMap . Set < ulong ? > ( DbType . Int64 , LongColumnDefinition ) ;
88
+
79
89
if ( CompactGuid )
80
90
{
81
91
DbTypeMap . Set < Guid > ( DbType . Binary , GuidColumnDefinition ) ;
@@ -86,6 +96,7 @@ public override void OnAfterInitColumnTypeMap()
86
96
DbTypeMap . Set < Guid > ( DbType . String , GuidColumnDefinition ) ;
87
97
DbTypeMap . Set < Guid ? > ( DbType . String , GuidColumnDefinition ) ;
88
98
}
99
+
89
100
DbTypeMap . Set < DateTimeOffset > ( DbType . String , DateTimeOffsetColumnDefinition ) ;
90
101
DbTypeMap . Set < DateTimeOffset ? > ( DbType . String , DateTimeOffsetColumnDefinition ) ;
91
102
}
@@ -361,26 +372,10 @@ public override void SetParameterValue<T>(FieldDefinition fieldDef, IDataParamet
361
372
362
373
protected override object GetValue < T > ( FieldDefinition fieldDef , object obj )
363
374
{
364
- var value = obj is T
365
- ? fieldDef . GetValue ( obj )
366
- : GetAnonValue < T > ( fieldDef , obj ) ;
375
+ var value = base . GetValue < T > ( fieldDef , obj ) ;
367
376
368
377
if ( value != null )
369
378
{
370
- if ( fieldDef . IsRefType )
371
- {
372
- //Let ADO.NET providers handle byte[]
373
- if ( fieldDef . FieldType == typeof ( byte [ ] ) )
374
- {
375
- return value ;
376
- }
377
- return OrmLiteConfig . DialectProvider . StringSerializer . SerializeToString ( value ) ;
378
- }
379
- if ( fieldDef . FieldType == typeof ( TimeSpan ) )
380
- {
381
- var timespan = ( TimeSpan ) value ;
382
- return timespan . Ticks ;
383
- }
384
379
if ( fieldDef . FieldType == typeof ( Guid ) )
385
380
{
386
381
var guid = ( Guid ) value ;
@@ -1075,5 +1070,16 @@ public override string ToAddForeignKeyStatement<T, TForeign>(Expression<Func<T,
1075
1070
GetQuotedColumnName ( referenceFieldName ) ,
1076
1071
GetForeignKeyOnDeleteClause ( new ForeignKeyConstraint ( typeof ( T ) , FkOptionToString ( onDelete ) ) ) ) ;
1077
1072
}
1073
+
1074
+ public override string EscapeWildcards ( string value )
1075
+ {
1076
+ if ( value == null )
1077
+ return null ;
1078
+
1079
+ return value
1080
+ . Replace ( "^" , @"^^" )
1081
+ . Replace ( "_" , @"^_" )
1082
+ . Replace ( "%" , @"^%" ) ;
1083
+ }
1078
1084
}
1079
1085
}
0 commit comments