@@ -32,7 +32,6 @@ public ElasticContractResolver(IConnectionSettingsValues connectionSettings, ILi
32
32
this . ConnectionSettings = connectionSettings ;
33
33
}
34
34
35
-
36
35
protected override JsonContract CreateContract ( Type objectType )
37
36
{
38
37
JsonContract contract = base . CreateContract ( objectType ) ;
@@ -44,12 +43,8 @@ protected override JsonContract CreateContract(Type objectType)
44
43
else if ( objectType == typeof ( ServerError ) )
45
44
contract . Converter = new ServerErrorJsonConverter ( ) ;
46
45
else if ( objectType == typeof ( DateTime ) || objectType == typeof ( DateTime ? ) )
47
- contract . Converter = new IsoDateTimeConverter ( ) ;
48
- else if ( ! objectType . FullName . StartsWith ( "Nest." , StringComparison . OrdinalIgnoreCase ) ) return contract ;
49
-
50
- else if ( ApplyExactContractJsonAttribute ( objectType , contract ) ) return contract ;
51
- else if ( ApplyContractJsonAttribute ( objectType , contract ) ) return contract ;
52
-
46
+ contract . Converter = new IsoDateTimeConverter ( ) ;
47
+
53
48
if ( this . _contractConverters . HasAny ( ) )
54
49
{
55
50
foreach ( var c in this . _contractConverters )
@@ -60,7 +55,12 @@ protected override JsonContract CreateContract(Type objectType)
60
55
contract . Converter = converter ;
61
56
break ;
62
57
}
63
- }
58
+ }
59
+ if ( ! objectType . FullName . StartsWith ( "Nest." , StringComparison . OrdinalIgnoreCase ) ) return contract ;
60
+
61
+ else if ( ApplyExactContractJsonAttribute ( objectType , contract ) ) return contract ;
62
+ else if ( ApplyContractJsonAttribute ( objectType , contract ) ) return contract ;
63
+
64
64
return contract ;
65
65
}
66
66
0 commit comments