devbition.com

through the eyes of a lifetime learner

Home » Creating Entity Framework POCO Objects with EF 4.x POCO Entity Generator

Creating Entity Framework POCO Objects with EF 4.x POCO Entity Generator

If you’re using Entity Framework and want to quickly generate POCO objects, EF 4.x POCO Entity Generator is a great tool to use. By simply downloading and installing the EF POCO Template from here if you’re using C# or from here if you’re using VB, you’re 90% of the way there.

From there you can easily generate POCO objects by simply right clicking on your EDMX file, clicking on the Add Code Generation Item option and selecting the EF 4.x POCO Entity Generator template:

Add Code Generation Item Menu Option

Add Code Generation Item Menu Option

EF 4.x POCO Entity Generator Template

EF 4.x POCO Entity Generator Template

After clicking OK to run the templates, you should then see two new T4 templates in your project (one file generates POCOs for you entities and the other file generates your ObjectContext):

Generated T4 Files

Generated T4 Files

…and there you have it.

Helpful links:
EF 4.x POCO Entity Generator download (C#)
EF 4.x POCO Entity Generator download (VB)
Other Entity Framework code generation templates

Name of author

Name: Tamika Harris-Smith

devbition.com