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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:13:11+00:00 2026-05-25T12:13:11+00:00

I have two models; User and Client. A user can have many clients and

  • 0

I have two models; User and Client. A user can have many clients and a client has one user. The project manager insists each users clients to be in a separate table so I must dynamically generate new tables for each user that is created. For example user ABC will have a new table called ABC_Clients, user XXX will have a separate table called XXX_Clients and so forth. My question: how do I do this with Entity Framework? I can simply execute a procedure to create the new table and do an manual query with ExecuteStoreQuery() but it doesn’t seem to pull relationships back (i.e. Lazy Load), do I have to construct my query in a certain way or something?

  • 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-25T12:13:12+00:00Added an answer on May 25, 2026 at 12:13 pm

    That is excellent design. It will be really easy to use and really nice to maintain. Congratulate your manager and tell him to do his job and let you do yours. Project manager is not architect and most often it is person with poor technical knowledge.

    There is no way to support this with EF. You must do it completely with SQL (actually dynamic SQL in this case) and old ADO.NET. ExecuteStoreQuery never returns relations – it is not able to do that. Lazy loading cannot work as well because standard lazy loading is based on static database structure mapped with Entity framework. Your Client entity cannot be mapped by EF because it demands that each entity will be mapped only once (= to one table or set of related tables in case of inheritance or splitting). Your Client entity would need to be mapped as many times as you have users in your User table.

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

Sidebar

Related Questions

I have two models, User and Account. Each user may have one account. Creating
I have two models: User and HairColor. A user has only one hair color,
I have two models: User MentoringRelationship MentoringRelationship is a join model that has a
I have set up two models: user and post . Each post belongs_to a
Basically I have two models: User and Godfather. The godfather table has three columns:
I have two models: User (id) Authentication (id, provider,..) How can I get all
I have two models -- User and Entry -- that are related through a
I have two models: class User end class Message belongs_to :sender, :class_name=> 'User' belongs_to
I have two models indexed for searching (User and Item). I'm trying to do
I have two models, user and group. I also have a joining table groups_users.

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.