I have the following code:
public class A
{
public Guid Id { get; set; }
public List<A> AList { get; set; }
}
Configured with fluent Api:
modelBuilder
.Entity<A>()
.HasMany(x => x.AList)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
Creating a Migration works fine but when doing "Update-Database" I get the following error:
"Introducing FOREIGN KEY constraint 'FK_A_A_AId' on table 'A' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint or index. See previous errors."
How do I delete cascade a tree in EF Core then?