Efcore: SuppressForeignKeyEnforcement is missing from SqliteDbContextOptionsBuilder

Created on 21 Aug 2019  路  2Comments  路  Source: dotnet/efcore

SuppressForeignKeyEnforcement is missing from SqliteDbContextOptionsBuilder in Microsoft.EntityFrameworkCore.Sqlite version 3.0.0-preview8.19405.11.

Steps to reproduce

```c#
DbContextOptionsBuilder optionBuilder = new DbContextOptionsBuilder();

optionBuilder.UseSqlite(connectionString, x => x.SuppressForeignKeyEnforcement());
```
This code worked fine with Microsoft.EntityFrameworkCore.Sqlite version 2.2.6.
Upgrade Microsoft.EntityFrameworkCore.Sqlite version 2.2.6 to 3.0.0-preview8.19405.11 and SuppressForeignKeyEnforcement is not there anymore

Further technical details

EF Core version: 2.2.6 and 3.0.0-preview8.19405.11
Database Provider: Microsoft.EntityFrameworkCore.Sqlite
Operating system: Windows 10
IDE: Visual Studio 2019 16.2.3

closed-question customer-reported

Most helpful comment

Breaking change, documented here:

https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#ef-core-no-longer-sends-pragma-for-sqlite-fk-enforcement

All 2 comments

Breaking change, documented here:

https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#ef-core-no-longer-sends-pragma-for-sqlite-fk-enforcement

Because FK enforcement is switched on by default starting with EF Core 3.0-preview 3, I removed x => x.SuppressForeignKeyEnforcement() part and everything works fine now.

Thank you for your prompt reply @ErikEJ

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miguelhrocha picture miguelhrocha  路  3Comments

HappyNomad picture HappyNomad  路  3Comments

julienshepherd picture julienshepherd  路  3Comments

iberodev picture iberodev  路  3Comments

bgribaudo picture bgribaudo  路  3Comments