Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible to generate the ADO.NET Entity Framework in C# while preserving the manually added tables. There are two approaches to achieve this:

  1. Use "Code First" Approach: In this approach, you can create C# classes for your manually added tables and map them to the database using attributes or Fluent API. Then you can use the "Code First" tool in the Entity Framework to generate the database schema based on the model you created. This way, the manually added tables will be preserved.

  2. Use "Database First" Approach: In this approach, you can create a database schema with your manually added tables and then use the "Database First" tool in the Entity Framework to generate the corresponding C# classes based on the schema. This way, the manually added tables will also be preserved.

In both approaches, you need to make sure that the manually added tables are not overwritten or modified during the generation process. To do this, you can use annotations or naming conventions to ensure that the Entity Framework doesn't generate duplicate tables or modify existing ones.