Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite type mapping should not be returned without converter when CLR type does not match #29633

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public static bool IsSpatialiteType(string columnType)

var storeTypeName = mappingInfo.StoreTypeName;
if (storeTypeName != null
&& _storeTypeMappings.TryGetValue(storeTypeName, out mapping))
&& _storeTypeMappings.TryGetValue(storeTypeName, out mapping)
&& (clrType == null || mapping.ClrType.UnwrapNullableType() == clrType))
{
return mapping;
}
Expand All @@ -149,15 +150,16 @@ public static bool IsSpatialiteType(string columnType)
{
var affinityTypeMapping = _typeRules.Select(r => r(storeTypeName)).FirstOrDefault(r => r != null);

if (affinityTypeMapping == null)
if (affinityTypeMapping != null)
{
return Blob;
return clrType == null || affinityTypeMapping.ClrType.UnwrapNullableType() == clrType
? affinityTypeMapping
: null;
}

if (clrType == null
|| affinityTypeMapping.ClrType.UnwrapNullableType() == clrType)
if (clrType == null || clrType == typeof(byte[]))
{
return affinityTypeMapping;
return Blob;
}
}

Expand Down
Loading