Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:28:33+00:00 2026-06-13T00:28:33+00:00

I am trying to develop an ASP.NET MVC 4 application where players can be

  • 0

I am trying to develop an ASP.NET MVC 4 application where players can be rated according to their Offence, Defence and Assist skills. Offence, Defence and Assist are foreign keys on Player table referencing the same lookup table – Rating.

I have the following parent entity:

public class Rating
{
    public int Id { get; set; }

    public string Name { get; set; }

    public virtual ICollection<Player> Players { get; set; }
}

And child entity:

public class Player
{
    public int Id { get; set; }

    public string Name { get; set; }

    public int OffenceRatingId { get; set; }
    [ForeignKey("OffenceRatingId")]
    public virtual Rating OffenceRating { get; set; }

    public int DefenceRatingId { get; set; }
    [ForeignKey("DefenceRatingId")]
    public virtual Rating DefenceRating { get; set; }

    public int AssistRatingId { get; set; }
    [ForeignKey("AssistRatingId")]
    public virtual Rating AssistRating { get; set; }
}

Building and scaffolding went fine but when I run the app, I get the following error:

Introducing FOREIGN KEY constraint 'FK_dbo.Players_dbo.Ratings_DefenceRatingId' 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.

I am new to MVC and have no idea what I am missing here. Any help with this will be greatly appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:28:34+00:00Added an answer on June 13, 2026 at 12:28 am

    By default, Entity Framework has a Cascade on Delete convention. When two entities have foreign keys to each other, it causes a circular reference and Cascade on Delete can’t be applied to both entities.

    The simplest solution is to remove the cascade on delete convention, and apply it on a case by case basis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to develop a web application using ASP.net MVC 2. For that
Im trying to develop my first ASP.NET MVC web app and have run into
I am trying to develop the single page in asp.net web mobile application as
I'm trying to develop an ASP.NET application by the book; I have my Web
I'm trying to use Sharp Architecture to develop ASP.NET MVC 3 app. But I
I am trying to develop ASP.NET web application and also Android UI for the
I'm trying to develop an authentication plugin for an ASP.NET MVC3 application that would
I'm trying to develop an app with ASP.NET MVC Mono. Installed latest version of
I'm trying to develop a c#/asp.net application to extract data from a SQL server
Trying to develop and test an ASP.NET MVC 2 as well as a hosted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.