Do the same clr type check when mapping "text" as what we do for other store type mappings. This allows conversions do work better (e.g. originally a mappingInfo with a System.Char type was passed in with store type of "text" and a variable length or unbounded string type was returned but with clr type of System.String. Going with the extra checked returns null and gets EF Core to find a converter and then do the mapping again on the converted type

pull/137/head
Christopher Jolly 3 years ago
parent ee54f1fac0
commit dc049d804d

@ -275,9 +275,20 @@ namespace EntityFrameworkCore.Jet.Storage.Internal
if (storeTypeNameBase!.Equals("text", StringComparison.OrdinalIgnoreCase) &&
!mappingInfo.IsFixedLength.GetValueOrDefault())
{
return mappingInfo.Size.GetValueOrDefault() > 0
? _variableLengthUnicodeString
: _unboundedUnicodeString;
if (mappingInfo.Size.GetValueOrDefault() > 0)
{
return clrType == null
|| _variableLengthUnicodeString.ClrType == clrType
? _variableLengthUnicodeString
: null;
}
else
{
return clrType == null
|| _unboundedUnicodeString.ClrType == clrType
? _unboundedUnicodeString
: null;
}
}
if (_storeTypeMappings.TryGetValue(storeTypeName, out var mapping)

Loading…
Cancel
Save