Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Jul 22, 2024
1 parent 60a1f70 commit 623b354
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,17 @@ public override int SaveChanges(bool acceptAllChangesOnSuccess)
}
}

//#if (database == "Sqlite")
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
//#if (IsInsideProjectTemplate == true)
if (Database.ProviderName!.EndsWith("Sqlite", StringComparison.InvariantCulture))
{
//#endif
//#if (database == "Sqlite")
// SQLite does not support expressions of type 'DateTimeOffset' in ORDER BY clauses. Convert the values to a supported type:
configurationBuilder.Properties<DateTimeOffset>().HaveConversion<DateTimeOffsetToBinaryConverter>();
configurationBuilder.Properties<DateTimeOffset?>().HaveConversion<DateTimeOffsetToBinaryConverter>();
//#endif
//#if (IsInsideProjectTemplate == true)
}
//#endif
Expand All @@ -75,16 +76,17 @@ protected override void ConfigureConventions(ModelConfigurationBuilder configura
if (Database.ProviderName.EndsWith("PostgreSQL", StringComparison.InvariantCulture))
{
//#endif
// SQLite does not support expressions of type 'DateTimeOffset' in ORDER BY clauses. Convert the values to a supported type:
//#if (database == "PostgreSQL")
// PostgreSQL does not support DateTimeOffset with offset other than Utc.
configurationBuilder.Properties<DateTimeOffset>().HaveConversion<PostgresDateTimeOffsetConverter>();
configurationBuilder.Properties<DateTimeOffset?>().HaveConversion<NullablePostgresDateTimeOffsetConverter>();
//#endif
//#if (IsInsideProjectTemplate == true)
}
//#endif

base.ConfigureConventions(configurationBuilder);
}
//#endif

private void ConfigureIdentityTables(ModelBuilder builder)
{
Expand Down

0 comments on commit 623b354

Please sign in to comment.