title: Entity Framework 5 namespaces
body: <p>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:</p>
  
  <ul>
  <li>The EDMX file name when adding ADO.NET entity data model to the project. I put ‘MyEF.edmx’.</li>
  <li>When saving the connection string into the config file. I put ‘MyEntities’.</li>
  <li>After selecting some tables to include in my model, there’s a textbox to input model namespace. I put ‘MyModel’.</li>
  <li>Property ‘custom tool namespace’ of the MyEF.edmx file. I put ‘TheEF’.</li>
  <li>Property ‘custom tool namespace’ of the MyEF.Context.tt file. I put ‘TheContext’.</li>
  <li>Property ‘custom tool namespace’ of the MyEF.tt file. I put ‘TheModel’.</li>
  </ul>
  
  <p>Opening MyEF.edmx with ADO.NET entity data model designer, looking at the properties of MyModel, there are:</p>
  
  <ul>
  <li>entity container name, filled with ‘MyEntities’. So the connection string name goes here.</li>
  <li>namespace, filled with ‘MyModel’. This is coming from the table selection textbox.</li>
  </ul>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Can someone explain the purpose of each label?</p>
  
  <p>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?</p>