@@ -30,33 +30,33 @@ namespace FirebirdSql.EntityFrameworkCore.Firebird.Query.ExpressionTranslators.I
30
30
31
31
public class FbConvertTranslator : IMethodCallTranslator
32
32
{
33
- static readonly Dictionary < string , string > TypeMappings = new Dictionary < string , string >
33
+ static readonly List < string > Mappings = new List < string >
34
34
{
35
- [ nameof ( Convert . ToByte ) ] = "SMALLINT" ,
36
- [ nameof ( Convert . ToDecimal ) ] = $ "DECIMAL( { FbTypeMappingSource . DefaultDecimalPrecision } , { FbTypeMappingSource . DefaultDecimalScale } )" ,
37
- [ nameof ( Convert . ToDouble ) ] = "DOUBLE PRECISION" ,
38
- [ nameof ( Convert . ToInt16 ) ] = "SMALLINT" ,
39
- [ nameof ( Convert . ToInt32 ) ] = "INTEGER" ,
40
- [ nameof ( Convert . ToInt64 ) ] = "BIGINT" ,
41
- [ nameof ( Convert . ToString ) ] = $ "VARCHAR( { FbTypeMappingSource . VarcharMaxSize } )"
35
+ nameof ( Convert . ToByte ) ,
36
+ nameof ( Convert . ToDecimal ) ,
37
+ nameof ( Convert . ToDouble ) ,
38
+ nameof ( Convert . ToInt16 ) ,
39
+ nameof ( Convert . ToInt32 ) ,
40
+ nameof ( Convert . ToInt64 ) ,
41
+ nameof ( Convert . ToString ) ,
42
42
} ;
43
43
44
44
static readonly HashSet < Type > SupportedTypes = new HashSet < Type >
45
- {
46
- typeof ( bool ) ,
47
- typeof ( byte ) ,
48
- typeof ( decimal ) ,
49
- typeof ( double ) ,
50
- typeof ( float ) ,
51
- typeof ( int ) ,
52
- typeof ( long ) ,
53
- typeof ( short ) ,
54
- typeof ( string ) ,
55
- typeof ( DateTime ) ,
56
- } ;
45
+ {
46
+ typeof ( bool ) ,
47
+ typeof ( byte ) ,
48
+ typeof ( decimal ) ,
49
+ typeof ( double ) ,
50
+ typeof ( float ) ,
51
+ typeof ( int ) ,
52
+ typeof ( long ) ,
53
+ typeof ( short ) ,
54
+ typeof ( string ) ,
55
+ typeof ( DateTime ) ,
56
+ } ;
57
57
58
58
static readonly IEnumerable < MethodInfo > SupportedMethods
59
- = TypeMappings . Keys
59
+ = Mappings
60
60
. SelectMany ( t => typeof ( Convert ) . GetTypeInfo ( ) . GetDeclaredMethods ( t )
61
61
. Where ( m => m . GetParameters ( ) . Length == 1 && SupportedTypes . Contains ( m . GetParameters ( ) . First ( ) . ParameterType ) ) ) ;
62
62
0 commit comments