Peter Smith
Peter Smith

Reputation: 5550

Adding an existing database table to a EF6 Code first repository

I have an Entity Framework 6 code first application. As a one-off, I want to add a entity class based on a table that has been added externally to the database originally generated from the code first application. I know how to do this manually, but I wondered if there is a tool or method that could generate the class for me.

Upvotes: 1

Views: 53

Answers (1)

Alexander Derck
Alexander Derck

Reputation: 14488

You can make a new project, right click on it -> Add new item -> ADO.NET Entity Data Model -> Database first

Then let entity framework generate models for your database and just copy the one you need to your project. That's probably the easiest solution :)

Upvotes: 1

Related Questions