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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:10:20+00:00 2026-05-27T01:10:20+00:00

I have a composite table called ImporterState, that are tied to a table called

  • 0

I have a composite table called ImporterState, that are tied to a table called Importer and State. The error happens here context.Importers.Include(q => q.States). Why is this happening?

{“Invalid object name ‘ImporterStates’.”}

    [Table("HeadlineWebsiteImport", Schema = "GrassrootsHoops")]
        public class Importer
        {
            public int Id { get; set; }
            public string Name { get; set; }
            public string RssUrl { get; set; }
            public string Type { get; set; }
            public string Keywords { get; set; }
            public bool Active { get; set; }
            public DateTime DateModified { get; set; }
            public DateTime DateCreated { get; set; }

            public int WebsiteId { get; set; }

            public HeadlineWebsite Website { get; set; }

            [InverseProperty("Importers")]
            public ICollection<State> States { get; set; }
        }

[Table("State", Schema = "GrassrootsHoops")]
    public class State
    {
        [Key]
        public int Id { get; set; }
        public string Name { get; set; }
        public string Abbr { get; set; }

        [InverseProperty("States")]
        public ICollection<Headline> Headlines { get; set; }

        [InverseProperty("States")]
        public ICollection<Importer> Importers { get; set; }
    }
  • 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-27T01:10:20+00:00Added an answer on May 27, 2026 at 1:10 am

    The many to many is not possible using attributes only.

    try using something like:

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
    
            modelBuilder.Entity<Importer>()
                .HasMany(i => i.States)
                .WithMany(s => s.Importers)
                .Map(m =>
                    {
                        m.MapLeftKey("ImporterId");
                        m.MapRightKey("StateId");
                        m.ToTable("ImporterState");
                    });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one table with composite key attribute.. For that i have made 2
I have a legacy table with composite keys that are mapped to 3 other
I have a table called table1 which has a composite primary key using 'ScreenId'
I have an injection table called StudentSchool that contains : StudentSchoolID StudentId SchoolID 1
I have a composite table called TeacherClass with two columns, TeacherID and ClassID. The
We have a composite primary key for the site table defined below. Functionally, this
I have a composite index on three column in one of my table. It
I have a composite control that contains a ListBox child control. On postback, the
I have a composite control that adds a TextBox and a Label control to
I have a composite control which emits HTML that looks like this <span id=myControl>

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.