Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public class Candidate
  2. {
  3. public int PCountryId { get; set; }
  4. public Country PCountry { get; set; }
  5.  
  6. public int NCountryId { get; set; }
  7. public Country NCountry { get; set; }
  8. }
  9.  
  10. Introducing FOREIGN KEY constraint 'FK_tblDetails_tblCountries_NCountryId' on table 'tblDetails' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
  11. Could not create constraint
  12.  
  13. public int? NCountryId { get; set; }
  14.  
  15. foreach (var relationship in modelBuilder.Model.GetEntityTypes().SelectMany(e => e.GetForeignKeys()))
  16. {
  17. relationship.DeleteBehavior = DeleteBehavior.Restrict;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement