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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:32:09+00:00 2026-05-25T19:32:09+00:00

I have task to build application for user registration. I have 3 types of

  • 0

I have task to build application for user registration. I have 3 types of user (profiles)

1. "Normal" user
2. "Company" user
3. "Company2" user - similar like 2. but with few additional fields..

All users share some specific info, like e-mail and password (Login data), role, registration date etc…. So, I’m trying to “design” classes for this type of app using only EF Code First approach, but with no luck..

Do I need table (class) for :

USER - all kind of users with all their Login data (email and password) and UserType
USERTYPE - list of all user types (1,2,3)
USER_DETAILS - details of normal user
COMPANY_DETAILS - details of company
COMPANY2_DETAILS -details of company2

My problem is how to reference USER table with USER_DETAILS, COMPANY_DETAILS, COMPANY2_DETAILS. I hope so that you understand my problem 🙂

My classes (user management and profile) is implemented like http://codefirstmembership.codeplex.com/ example.

Thank you in advance!

  • 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-25T19:32:09+00:00Added an answer on May 25, 2026 at 7:32 pm

    You can use a normal inheritance model with Entity Framework.

    I would just use a base class User that contains the login data (please don’t store the password in the DB though, use a hash – Membership should do this for you already) and other user info, then you can add another class CompanyUser that inherits from User and contains the additional properties. Finally CompanyUser2 (needs a better name) can inherit from CompanyUser.

    Having this in place there are different models you can use on how EF maps your classes to tables:

    1.) Table-per-Hierarchy

    2.) Table-per-Type

    3.) Table per Concrete Type

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

Sidebar

Related Questions

I have a custom build of a Unix OS. My task: Adding an IPSec
I'm using nant to build our product and have written a custom task to
I'm trying to build a simple application, with the finished program looking like this
I have an application that lets users build things in JS. I want the
I have the following question: I was given the task - to build an
My application is build in C#4, using Prism (CAL) and WPF. We have the
I am trying to build a simple desktop application where the user enters the
Hey guys I am trying to build a signature task application . In which
I have build the Spring MVC application and got it to an advanced level.
I have a Java application and a build file which, among its tasks, has

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.