Getting Started with Entity Framework Code-First with an Existing Database
When you’re just getting started with C#, you can get overwhelmed by the benefits and drawbacks of the different ORMs and approaches people take.
Say you have a lot of SQL under your belt. Entity Framework Code-First sounds great, but you’re not sure how to get comfortable with it.
You want to start small by reading and writing to an existing database. All you want to do is map a simple model to an existing table.
Where can a C# beginner start without feeling thrown into the Entity Framework Code-First deep end?
Reverse Generate POCOs from an Existing Database
The Entity Framework Reverse POCO Generator Visual Studio Extension by Simon Hughes can be helpful for learning Code-First with your existing databases.
Reverse POCO Generator reverse engineers an existing database and generates Entity Framework Code First POCO classes, configuration mappings, and DbContext (reversepoco.com)
This extension can be helpful if you are:
- Just wanting to get started somewhere with Code-First and are looking for a jumping-off point with an existing database
- Very comfortable with SQL and relational database modeling
- Needing to model your database before writing your application
- Integrating custom off the shelf applications with proprietary database schema
- Integrating legacy systems quickly
Summary
While there are a ton of good resources out there for people new to Entity Framework, it’s hard to find ones that are focused towards your unique SQL background/workflow.
Then Entity Framework Reverse POCO Generator can really help you out. It’s actively maintained too!
Simon Hughes is working on a Pluralsight course on Reverse POCO Generator, so keep an eye on that.
If you have any questions about Reverse POCO Generator, go ahead and sign up for my newsletter, email me, tweet me, or leave a comment below! I’ll do my best to answer, or at least point you in the right direction.
Sources:
Hughes, Simon. Entity Framework Reverse POCO Generator. Github.