I have a table with a many to many relation table here is config
HasMany(pb => pb.DeletedProducts)
.WithMany()
.Map(m =>
{
m.ToTable("ProductBatchDeleted");
m.MapLeftKey("BatchId");
m.MapRightKey("ProductId");
});
There is no cascade delete option available for this as far as i can see.
Here is the delete code
await _context.DbSet<ProductBatch>()
.DeleteAsync();
It fails with a constraint error because the table ProductBatchDeleted
has a constraint to it. Can I fix so that the Extend
library understands that it has todo a delete on the ProductBatchDeleted
table first?