I have a simple sqlite database with two tables. When I manually delete (using SQLite Expert) the record in the DataSets table, the corresponding record in OneD is deleted as expected. When I delete a record in DataSets from the Entity Framework, this does not delete the control record in One D. Failure is not generated.
Any idea why?
Hello
Here is the database definition:
CREATE TABLE [DataSets] ( [DataSetId] INTEGER NOT NULL ON CONFLICT FAIL PRIMARY KEY AUTOINCREMENT, [Description] TEXT(128)); CREATE TABLE [OneD] ( [OneDId] INTEGER NOT NULL ON CONFLICT FAIL PRIMARY KEY ON CONFLICT ABORT AUTOINCREMENT, [DataSetId] INTEGER NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT ABORT REFERENCES [DataSets]([DataSetId]) ON DELETE CASCADE, [StockSheetLength] INTEGER NOT NULL ON CONFLICT FAIL);
This is how I delete an entry from EF
var dataSets = from ds in context.DataSets select ds; foreach (var ds in dataSets) context.DataSets.DeleteObject(ds); context.SaveChanges(); return true;
source share