Search code examples
.netvb.netentity-frameworkcode-first

How to Reverse Engineer Code First for a VB .net project using the Entity Framework


I have managed this using the following steps

  1. Create a new C# project
  2. Use the Entity Framework Power Tools to create the models and Mapping in that project from the database
  3. Upload the files to http://converter.telerik.com/batch.aspx to convert them to VB .NET
  4. Download the VB files
  5. Add the VB files to the VB .NET project I am working on
  6. Fix any errors caused by the conversion

Does anyone know of a simpler way to do this?

Edit If there isn't another way, I could write my data access layer in a separate C# assembly which would work around the problem.


Solution

  • The answer is simple: Entity Framework Power Tools is for C# only.

    However, it is meant to give you a quick start in code-first projects. Once you reverse-engineered your POCO's you can proceed the code-first way, i.e. modify the class model and use migrations to modify the database. So I think it's not a big point to do this the way you do. You're probably not going to do it too often.