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 7048601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:54:41+00:00 2026-05-28T02:54:41+00:00

I have an Entity called User. User should be used in multilingual environment So

  • 0

I have an Entity called User. User should be used in multilingual environment
So User looks like

    class User{
 virtual ICollection<TextEntry> Name {get; set;}
 virtual ICollection<TextEntry> Info {get; set;}
...
}

class TextEntry
{
int id {get; set;}
string Text {get; set;}
string Culture {get;set;}
}

Also I have a rule for user

    modelBuilder.Entity<User>()
        .HasMany(q => q.Name)
        .WithOptional()
        .WillCascadeOnDelete();

    modelBuilder.Entity<User>()
        .HasMany(q => q.Info)
        .WithOptional()
        .WillCascadeOnDelete();

With this rules EF could not create model
Esception message is “Introducing FOREIGN KEY constraint ‘User_Info’ on table ‘TextEntry’ may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.\r\nCould not create constraint. See previous errors.”

Without this rules I get an exception when trying delete user, because of references constraints.

How it possible to solve this wihout creating additional entity for User.Info data?

  • 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-05-28T02:54:42+00:00Added an answer on May 28, 2026 at 2:54 am

    This error is from SQL Server, not from Entity Framework. Entity Framework is creating one table for both occurrences of TextEntry.

    Probably the easiest solution is to derive from TextEntry two other classes, make TextEntry abstract and map these two to distinct tables (TPC).

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

Sidebar

Related Questions

I have entity model like this (using EclipseLink and JPA 2.0): @Entity class A
I have an entity loaded by Hibernate (via EntityManager ): User u = em.load(User.class,
I have mapped class in JPA. : @Entity @Inheritance(strategy = InheritanceType.JOINED) public class User
I have an entity called User which can have a list of other Users
Hi i have an entity called User with 2 properties called UserName and Role
For example, lets say I have an entity called user and an entity called
Lets say I have an entity called User which has many Posts. My service
I have a two entity classes called User and Group, both reserved words that
Lets say we have User entity class. User can be friends with other users.
I have a class called UserContext that tracks the activities of a given user

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.