We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have this model that has DateTimeOffset properties that I need to use in Sqlite.
DateTimeOffset
I've added this value converter:
public override void Customize(ModelBuilder modelBuilder, DbContext context) { base.Customize(modelBuilder, context); var dateTimeOffsetToDateTimeConverter = new ValueConverter<DateTimeOffset, DateTime>( v => v.DateTime, v => new DateTimeOffset(v)); foreach (var entityType in modelBuilder.Model.GetEntityTypes()) { foreach (var property in entityType.GetProperties()) { if (property.ClrType == typeof(DateTimeOffset)) { property.SetValueConverter(dateTimeOffsetToDateTimeConverter); } } } }
However, when using ExecuteUpdateAsync Sqlit cannot translate the query:
ExecuteUpdateAsync
... could not be translated. Additional information: Translation of method 'System.DateTimeOffset.AddHours' failed.
Is there a way around this?
The text was updated successfully, but these errors were encountered:
Duplicate of #10434
Sorry, something went wrong.
No branches or pull requests
I have this model that has
DateTimeOffset
properties that I need to use in Sqlite.I've added this value converter:
However, when using
ExecuteUpdateAsync
Sqlit cannot translate the query:Is there a way around this?
The text was updated successfully, but these errors were encountered: