Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I hope I am not late. I am using <code>ASP.NET MVC</code> 4 and <code>Entity Framework 6 alpha 3</code> and ran into a similar problem.</p> <p>I have multiple projects in my solution. The 2 main projects are:</p> <pre><code>MyProject.Infrastructure.EntityFramework MyProject.Web </code></pre> <p>In the first project I would set up all my repositories, <code>DbContext</code>, etc etc. In this project I have 2 references:</p> <pre><code>EntityFramework EntityFramework.SqlServer </code></pre> <p>The second project is my website. It uses the repositories in the first project to return my data. For example:</p> <pre><code>private readonly IMyRepository myRepository; public MyController(IMyRepository myRepository) { this.myRepository = myRepository; } public ActionResult Details(int id) { MyObject myObject = myRepository.FindById(id); return View(); } </code></pre> <p>This is where I had my issues, calling <code>FindById</code>.</p> <p>All that I did was to add the following reference to my website:</p> <pre><code>EntityFramework.SqlServer </code></pre> <p>In my web.config:</p> <pre><code>&lt;configSections&gt; &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt; &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt; &lt;/configSections&gt; </code></pre> <p>And beneath the closing <code>system.webServer</code> tag:</p> <pre><code>&lt;entityFramework&gt; &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt; &lt;parameters&gt; &lt;parameter value="v11.0" /&gt; &lt;/parameters&gt; &lt;/defaultConnectionFactory&gt; &lt;/entityFramework&gt; </code></pre> <p>I hope this will help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload