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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:43:18+00:00 2026-06-18T07:43:18+00:00

I want to add Entity Framework 5 database first into a class library in

  • 0

I want to add Entity Framework 5 database first into a class library in Visual Studio 2012 targeting .net framework 4.5. I am confused with all the labels I need to key in:

  • The EDMX file name when adding ADO.NET entity data model to the project. I put ‘MyEF.edmx’.
  • When saving the connection string into the config file. I put ‘MyEntities’.
  • After selecting some tables to include in my model, there’s a textbox to input model namespace. I put ‘MyModel’.
  • Property ‘custom tool namespace’ of the MyEF.edmx file. I put ‘TheEF’.
  • Property ‘custom tool namespace’ of the MyEF.Context.tt file. I put ‘TheContext’.
  • Property ‘custom tool namespace’ of the MyEF.tt file. I put ‘TheModel’.

Opening MyEF.edmx with ADO.NET entity data model designer, looking at the properties of MyModel, there are:

  • entity container name, filled with ‘MyEntities’. So the connection string name goes here.
  • namespace, filled with ‘MyModel’. This is coming from the table selection textbox.

Putting something into the edmx custom tool namespace doesn’t seem to do anything. I got this conclusion because when I grep the entire source code folders, I found it only in a vbproj file.

Putting ‘TheModel’ into MyEF.tt custom tool namespace produces error from MyEF.Context.vb saying type ‘MyTable’ (this is the name of my database table) is not defined.

Can someone explain the purpose of each label?

If I want to put all the classes generated by this one edmx (DbContext, models, etc.) into one namespace, ‘MyEF’, what should I put in each of those places?

  • 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-06-18T07:43:20+00:00Added an answer on June 18, 2026 at 7:43 am

    The various properties are used as follows:

    • EDMX file name –> Used for the EDMX file name
    • Connection string name –> Used for the connection string name in the config file, and also for the container name of the conceptual model (CSDL) part of the EDMX
    • Model namespace –> Used for the namespace of the conceptual model (CSDL) part of the EDMX, and also for the store model (SSDL) part with .Store appended
    • Custom tool namespace for the EDMX file –> I don’t believe this is used for anything when using T4 generation of POCO entities. When using EF1-style built in code generation, setting this property will set the .NET namespace for all generated files.
    • Custom tool namespace for .Context.tt file –> The .NET namespace used in the source file for the context
    • Custom tool namespace for .tt file –> The .NET namespace used in the source files for the entities

    Note that if you set the .Context.tt and .tt custom namespaces to different things, then the context will be generated in a different namespace to the entity types and this won’t compile out-of-the-box. You can update the .tt files if you want to use different namespaces here, but more often people just use the same namespace for both.

    Also note that you may need to choose “Run Custom Tool” from the context menu for each .tt file after changing the properties in order for the code to be re-generated.

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

Sidebar

Related Questions

So I've started to add Entity Framework 4 into a legacy web application (ASP.NET
I'm trying to add business logic to my database first entity framework appplication. I
I am creating a database with Entity Framework 4 and Visual Studio 2010. I
I am using Entity Framework Code First. I want to query entites from database
I want to disable cascade deletes for a link table with entity framework code-first.
I'm writing an ASP.net MVC3 application using Entity Framework Code First and SqlCe4. I
I've created a web application project in Visual Studio 2010 using Entity Framework Code
I'm using Entity Framework 4. I am using a database first model, meaning that
I'm using Entity Framework Reverse Engineer Code First on an existing database. The classes
Basically I use Entity Framework to query a huge database. I want to return

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.