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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:45:14+00:00 2026-05-21T06:45:14+00:00

I started using Entity Framework (Using POCO Classes) for a MVC 3 C# project

  • 0

I started using Entity Framework (Using POCO Classes) for a MVC 3 C# project with Razor Views.

I am having trouble implimenting the Many to Many features with it

I am trying to Create a View that when a User is able to add phone numbers, emails, musictypes, flags, holds, ntoes, etc… through Many to Many relationships

i.e.) Company —-> CompanyVenue <—- Venue

I have managed to get EF storing the Venue and then being able to asign the Venue afterwards by selecting the Venue in a list and assigning to to the Company.

Is there a way to get The Venue to automatically store the relationship from the Company to the Venue with out having to select it though a list?

If that is not possible can anyone share a better way of Implimenting using EF.

  • 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-21T06:45:15+00:00Added an answer on May 21, 2026 at 6:45 am

    Just by having this simple setup:

    public Company
    {
        public virtual ICollection<Venue> Venues { get; set; }
    }
    
    public Venue
    {
        public virtual ICollection<Company> Companies { get; set; }
    }
    

    EF should be able to determine that you’re declaring a many-to-many relation. I don’t know if you’re using EF 4.1 Code First or the model designer, but Code First should have enought with this to create the CompanyVenue table for you. And the model designer will define the “link” table for you as well as soon as you declare a many-to-many relation.

    Note that the navigation properties are marked as virtual. This is necessary in the case of collections so that EF can make the proper updates in the related entities.

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

Sidebar

Related Questions

I am just getting started with Microsoft's Entity Framework, using it for an MVC
I started an ASP.NET project with Entity Framework 4 for my DAL, using SQL
I'm using Entity Framework 4 with the Model First approach. I started the project,
I am getting started with Entity Framework using POCO in a model-first configuration. I
I am using Entity Framework with my website. To improve performance, I have started
I am getting started with Entity Framework using EF4 in VS 2010 RC. So
I am getting started with Entity Framework 4, using model-first development. I am building
I have started to look at the Entity Framework for a project I am
I'm trying to get started using the latest Entity Framework 4 release on Visual
Using VS 2010 beta 2, ASP.NET MVC. I tried to create an Entity framework

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.