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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:58:07+00:00 2026-05-24T06:58:07+00:00

I am moving my first steps in the Entity Framework 4.0, and I am

  • 0

I am moving my first steps in the Entity Framework 4.0, and I am currently facing an annoying issue.

The authentication/authorization process of my application is based on the standard ASP.NET membership provider, in other words the database is the well-known ASPNETDB.MDF. In this database there are – amongst others – the tables aspnet_Users and aspnet_Roles, which are linked together by the table aspnet_UsersInRoles.

I generated a new “ADO.NET Entity Data Model”, I selected Generate from Database, I provided all the necessary parameters, and the wizard generated for me the relative .EDMX file. I named this “SecurityModel”. In the aspnet_User entity I can see there is a navigation property that should retrieve all linked Roles, and viceversa.

At this point I added a new “Domain Service”, in my case SecurityDomainService.
When I was asked, I selected the SecurityModel, and all the tables it contains.
Even in this case the wizard generated the SecurityDomainService for me.

Apparently no problems at all. However, I realized that in the entity aspnet_User I have all navigation properties (Membership, Profile, Applications, etc.) but Roles.

I read somewhere that EntityFramework doesnt handle many-to-many relationships. However I can see in my Entity Data Model that an Association exists between aspnet_Roles and aspnet_Users, and it is based on aspnet_UsersInRoles. I can also see in the Data Model designer the “Roles” navigation property in the User entity.

So, my question is why has not this navigation property been generated?

Thanks in advance for all your help.
Cheers,
G.

  • 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-24T06:58:08+00:00Added an answer on May 24, 2026 at 6:58 am

    The problem here is that the aspnet_UsersInRoles table contains only the primary key fields of the tables in the many to many relationship. Entity Framework ‘inlines’ this table and does not represent it as an entity. Entity Framework handles this fine – it is RIA services that does not support this type of relationship.

    Simply adding one extra field to the table will prevent it from being inlined and result in an aspnet_UsersInRoles being generated. This will be supported within RIA Services.

    You will need to be careful modifying the aspnet schema to ensure that you do not break any of the stored procedures etc but the addition of a nullable bit column should not cause too much disruption.

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

Sidebar

Related Questions

Im moving first steps into JSF framework. I so make these jsp/bean : index.jsp
Im moving first steps today on GWT framework. I need to understand (using the
I'm using Eclipse 3.4.1, moving my first steps. When I run my project (a
When moving my .Net Compact Framework application to the SD-card of a Windows CE
I just made my first steps moving into Objective-C . I have a very
I have a JEE6 project based on Glassfish 3.1.1 that is moving beyond the
I am writing a script to clean up my desktop, moving files based on
I'm having difficulty moving an image to another location after the first animation is
Rep steps: create example .NET form application put a TextBox on the form wire
Whats the motivation of first moving the chosen pivot element to the end of

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.