I have this model definition and I want to cascade delete on it.
With modelBuilder.Entity(Of dbDimension)()
.Property(Function(t) t.dbDimensionID).
HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
.HasKey(Function(t) t.dbDimensionID)
.Property(Function(t) t.Name).
HasColumnName("DimensionName")
.ToTable("Dimension")
modelBuilder.Entity(Of dbDimension)().
HasRequired(Function(t) t.Model).
WithMany(Function(t) t.mDimensions).
HasForeignKey(Function(t) t.dbModelID_FK).
WillCascadeOnDelete(True)
modelBuilder.Entity(Of dbDimension)().
HasMany(Function(t) t.Cubes).
WithMany(Function(t) t.Dimensions).
Map(Sub(m)
m.ToTable("Dimension-Cube")
m.MapLeftKey("dbDimensionID")
m.MapRightKey("dbCubeID")
End Sub)
End With
at the moment when I delete model, dimensions get deleted as well but the many to many relationshipt doesn't get deleted. What can I do to fix this?
I'm using Dotconnect (SQLLite) as db driver.