when you getting Error in entity Framework :-
Introducing FOREIGN KEY constraint 'FK_dbo.Customers_dbo.States_StateId' on table 'Customers'...
Solution :-
Introducing FOREIGN KEY constraint 'FK_dbo.Customers_dbo.States_StateId' on table 'Customers'...
Solution :-
Add this method in the context database class:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
}
No comments:
Post a Comment