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

SqLiteOperationsAdapter.LoadSqliteValues: Property converters aren't being used if the property name is different to the column name #859

Closed
smnplicity opened this issue Jun 22, 2022 · 1 comment
Labels

Comments

@smnplicity
Copy link

The key of ConvertibleColumnConverterDict is the SQLite column name, and the contains key check is on the property name. If these two differ e.g. via annotations, the converter does not get invoked.

Changing the lookup to use propertyColumn.Value appears to work:

if (tableInfo.ConvertibleColumnConverterDict.ContainsKey(propertyColumn.Value) && value != DBNull.Value)
{
    value = tableInfo.ConvertibleColumnConverterDict[propertyColumn.Value].ConvertToProvider.Invoke(value);
}

This issue was observed as a result of the DateTimeOffset converter required for Sqlite: dotnet/efcore#10784 (comment)

@smnplicity smnplicity changed the title SqLiteAdapter.LoadSqliteValues: Property converters aren't being used if the property name is different to the column name SqLiteOperationsAdapter.LoadSqliteValues: Property converters aren't being used if the property name is different to the column name Jun 22, 2022
@borisdj borisdj added the bug label Jul 6, 2022
@borisdj
Copy link
Owner

borisdj commented Jul 7, 2022

Fixed with v6.5.3

@borisdj borisdj closed this as completed Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants