Introducing FOREIGN KEY constraint 'FK_dbo.ChildProfile_dbo.SourceType_SourceTypeId' on table 'ChildProfile' 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. See previous errors.
Answer
Also you can modify your migration class. In my case in the migration class was:
Make "cascadeDelete: false" Update-Database works perfectly.
OR
Add this code in context
Update-Database works perfectly.
Could not create constraint. See previous errors.
Answer
Also you can modify your migration class. In my case in the migration class was:
Make "cascadeDelete: false" Update-Database works perfectly.
OR
Add this code in context
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
}
Update-Database works perfectly.
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDelete.Net Online Course
Thankyou your post is very useful...
ReplyDelete