Click here to Skip to main content
15,900,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I'm testing usage of Entity Framework 6.0 on Code First approach for a c# application.
I have established the database connection and successfully brought in all my tables as classes using the wizard.

Now my problem is, using CodeDOM I created a class at runtime. But how am I suppose to get the DBSet entries in the context class ??

How can I make EF create a table in the database for this class ? Is it possible at all ??

Please suggest a solution. Thanks in advance.

What I have tried:

I tried this link and several other sites but no where Iam able to get a solution for my issue.
Updated 15-Jan-19 8:30am

1 solution

Under CodeFirst, you do a migration of the database. Read up on it here[^].
Share this answer
Maciej Los 16-Jan-19 2:51am    
Priya-Kiko 16-Jan-19 5:55am    
Thank you so much, @Dave Kreskowiak, for a clear cut clarification and for routing to an apt link. Now will try with the same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900