none
Entity Framework with Visual Studio 2012 EXPRESS

    Question

  • hello everyone

    I have Visual Studio 2012 Express (Web and Desktop) installed with .NET 4.5 and SQL 2012 Developer Edition.

    Can I use *Code First* and DbContext with Entity Framework 5 with this Express software?

    I tried to install Power Tools so I can use DbContext and Code First but installation fails.

    Many thanks


    Yuri Budilov

    Monday, June 17, 2013 1:36 AM

Answers

  • Hi;

    If you have an existing database and you want to use code first you will need the Power Tools to reverse engineer the schema of the database. The Power Tools is a Visual Studio plug-in but VS plug-ins are NOT supported in Visual Studio Express, sorry.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Yuri Budilov Monday, June 17, 2013 3:06 AM
    Monday, June 17, 2013 3:02 AM

All replies

  • Hi Yuri;

    To your question, "Can I use *Code First* and DbContext with Entity Framework 5 with this Express software?", Yes you can and you do not need to install Power Tools to do so. All you need to do is create your entities and derive your contexts from DbContext.

    The Power Tools is used to reverse engineer and already existing database so that you can use Code First. But if you are creating a new database with the application then you do not need to do that.

    What is the error you are getting when installing Power Tools?

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, June 17, 2013 2:22 AM
  • many thanks for such a rapid reply.

    I am new to EF (I do have ADO.NET experience).

    is there a EF paper, presentation, video, etc showing me how to do the steps you described without Power Tools ?

    many thanks again


    Yuri Budilov

    Monday, June 17, 2013 2:26 AM
  • Hi Yuri;

    Try out the Microsoft Developer Center web site

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, June 17, 2013 2:40 AM
  • Hi Yuri;

    To your question, "Can I use *Code First* and DbContext with Entity Framework 5 with this Express software?", Yes you can and you do not need to install Power Tools to do so. All you need to do is create your entities and derive your contexts from DbContext.

    The Power Tools is used to reverse engineer and already existing database so that you can use Code First. But if you are creating a new database with the application then you do not need to do that.

    What is the error you are getting when installing Power Tools?

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    hello again

    to clarify for me please - the suggestion you made above will work with existing database schema too?

    thanks!


    Yuri Budilov

    Monday, June 17, 2013 2:49 AM
  • Hi;

    If you have an existing database and you want to use code first you will need the Power Tools to reverse engineer the schema of the database. The Power Tools is a Visual Studio plug-in but VS plug-ins are NOT supported in Visual Studio Express, sorry.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Yuri Budilov Monday, June 17, 2013 3:06 AM
    Monday, June 17, 2013 3:02 AM
  • thanks for all the answers, I feared that..... 8^)

    so my two painful solutions are either (1) buy a VS 2012 Professional or (2) write my own manual column/property mapping between my C# entities and my existing database schema tables/procedures/views. Painful......


    Yuri Budilov

    Monday, June 17, 2013 3:10 AM
  • Hi;

    If you choose to go with option two please see the following two links they talk about Code First and a existing DB.

    Code First: Mapping Fluent API

    Code First Relationships Fluent API


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, June 17, 2013 3:41 AM
  • Many thanks. I will book mark these now....


    Yuri Budilov

    Monday, June 17, 2013 3:44 AM
  •   

    Good luck and have a great day.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, June 17, 2013 3:45 AM