I have trawled through the web for a day or two for a solution and maybe I'm being stupid but I keep getting the above error when running my project.
Visual Studio 2010, SQL Explress.
I have a group of models with a "one to many" relationship. County->Club->Team->Player
So I can access the "parent / belonging to" models properties in an index list view I have successfully added:
For example, in the club model to access it's parent county properties:
public int CountyId { get; set; }
public virtual County County { get; set; }
This has worked all along the chain until I reach the "player" class. Wanting to list what club the player belongs to (rather than just the ID) I introduce the following ,
public int ClubId { get; set; }
public virtual Club Club { get; set; }
I get:
Introducing FOREIGN KEY constraint 'Player_Club' on table 'Players' 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.
Why can't I do this?