Entity Framework Code RRS feed

  • Question

  • I am developing application which will be used by Students, Providers, Administrator, Agents, etc. I am creating a Users table in database where login information of each user of the system (Agents,Students,Providers etc) will be stored and their respective fields (like firstname, lastname, etc) will be saved in respective tables like Students, Providers, etc. I am keeping userId which is primary key from users table as foreign key in other tables for relations.

    The database will get hit when Student, Provider, etc are registering for the system through registration form. User related data will get stored in Users table and other fields specific to that entity will get store in its respective table.

    I am using Entity Framework Code First with fluent API. Please help me to create model classes for these tables. Also there is one Interests table where while registering a Student can select multiple Interests from the available interest from dropdown which will get fill from Interests table. I want to store this as well in StudentsInterests table. Help me to create model class for this as well.


    Saturday, December 8, 2012 10:30 AM


  • Hi pbhalchandra,

    as i understand from your post you are somewhat familiar with Entity Framework Code First model and you want  to create an application .

    But actual problem is not clear from your post . Where are you getting obstacle ? Have you first created any demo application based on code first EF ?

    If not , i suggest please follow this link . Please follow this link on how to choose Primary Key in an effective way since the way you are saying to create primary key is not efficient (userid should not be kept primary key).

    One good question is equivalent to ten best answers.

    • Marked as answer by Alexander Sun Wednesday, December 26, 2012 2:24 AM
    Saturday, December 8, 2012 11:26 AM