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

  • Home
  • SEARCH
  • 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 1070337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:32:46+00:00 2026-05-16T20:32:46+00:00

I have a large table that I want to map to a few entities.

  • 0

I have a large table that I want to map to a few entities.

Say the table looks like this: Thing(ThingId, Property1…Property20)

Now I have my entities:

public abstract class ThingBase
{
    public int ThingId { get; set; }
    public string Property1 { get; set; }
    public string Property2 { get; set; }
}

public class ThingSummary : ThingBase
{
    public string Property3 { get; set; }    
}

public class Thing : ThingBase
{
    public string Property3 { get; set; }
    //...
    public string Property20 { get; set; }
}

How do I set up my DbContext so it will work? I had:

public DbSet<ThingSummary> ThingSummaries { get; set; }

public DbSet<Thing> Things { get; set; }

but I get an error “Invalid object name ‘dbo.ThingSummaries’.” when I try to query.

I have tried adding to OnModelCreating:

modelBuilder.Entity<ThingSummary>().MapSingleType().ToTable("Things");

but this did not seem to do anything.

Any ideas?

  • 1 1 Answer
  • 1 View
  • 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-16T20:32:46+00:00Added an answer on May 16, 2026 at 8:32 pm

    I think you can’t have ThingSummaries. You can only have Things. You also can’t use MapSingleType because it says that only single type will be mapped to the table. You have to use MapHiearchy instead. I posted example of such mapping in this question.

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

Sidebar

Related Questions

I have a large table that get populated from a view. This is done
I have a large reporting table in Excel that looks similar to the following.
We have a large MyISAM table that is used to archive old data. This
I have a large table and want to create a smaller table that systematically
I have a large number of records, say around 4,000,000, that I want to
I have a large table of birthdays that I want to convert from a
I have a large table with list of scores like this, one score per
I have a large database and would like to select table names that have
I have a large database table that I need to display on a Windows
I have a large table of data (that displays test data) that is separated

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.