Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • nickornotto 403 posts 907 karma points
    Jul 02, 2014 @ 11:38
    nickornotto
    0

    Problem with System.Data.Entity and DbContext MVC Umbraco 7

    Hi, I'm trying to connect to the database in code behind of my Umbraco 7 MVC project.

    I understand that I can use System.Data.Entity.DbContext for that eg.

    public class umbracoDbDSN : DbContext
    {
    }
    

    The thing is that my project doesn't see DbContext.

    I added reference to System.Data.Entity both in references and in web.config assemblies. That didn't help. So then also added EntityFramework.dll and in web.config as advised by different sources but still cannot make it working.

    Basically project compiles successfully but I'm still getting DbContext cannot be found problem.

    Any suggestions?

    Thank you

  • nickornotto 403 posts 907 karma points
    Jul 02, 2014 @ 15:50
    nickornotto
    1

    Ok, solved :)

    I followed this: http://www.nuget.org/packages/EntityFramework/

    In short installed EntityFramework through NuGet Package Manager and it works

Please Sign in or register to post replies

Write your reply to:

Draft