This project is read-only.

Code First

Aug 11, 2011 at 7:13 AM

I`ve updated nhydrate to latest version. After update, I cannot see the option to generate EF Code First DAL.

I`m using VS2010.

Aug 11, 2011 at 10:09 PM

did you verify that you have the file Widgetsphere.Generator.EFDAL.dll in "C:\Program Files\Widgetsphere\CodeTools"


Aug 12, 2011 at 12:07 AM
Edited Aug 12, 2011 at 12:08 AM

Yes I have this file in the installation folder. But when I click on tools\Generate, I don`t see an option to generate code first DAL, only traditional EFDAL (edmx)

Aug 12, 2011 at 1:30 AM

Code first is not in the install. There is an Entity Framework DAL but it is not the code first bits. We did experiment with a new generator based on code first but this was never supposed to be general release. Maybe it was added to a previous install acceidently. Please use the EFDAL and EFDAL Interfaces to build against Entity Framework.

Aug 12, 2011 at 5:39 AM

Are there plans to release generator based on EF Code First ? Since now many people are starting new projects with 4.1 + EF Power Tools, I like the model driven development way from nHydrate.

Aug 13, 2011 at 5:07 PM

There are no plans right now because there is already an Entity Framework solution. Code first merely allows you to create code and have your database follow from code. There is no model. This is a sub-optimal solution because there is no model and thus no single place to design your data diagram. Since an nHydrate model would create the code and the database for you, there is no difference between code first and the current EFDAL. The model generates code, so it really doesn't matter what code it generates. In fact I can think of no real difference in using the a code first DAL and the current EFDAL. You would interact with the code in the same way. Why do you want to generate code first as opposed to the EFDAL? Is there some functionality that it contains or some business need that it serves? If we can find a compelling reason to use code first we might go down this road.