user1166905
user1166905

Reputation: 2622

Convert MS SQL Server Table to a C# Class

I have a project that is using Entity Framework Code First but with an Existing Database. So far I have been creating the class for each existing table accordingly and it's all worked out great. What would be brilliant is if there was some way to quickly generate a table to a class to save time on manually coding each class, any ideas? I want to stay with Code First so please don't suggest alternatives, thanks.

Upvotes: 1

Views: 1202

Answers (1)

Prescott
Prescott

Reputation: 7412

You can use EF database first - that will generate .cs classes you can use as a base. Just copy the CS code and then delete the EF database first stuff.

Upvotes: 1

Related Questions