Can i create multiple tables using same model in EF core asp.net

asp.net c# entity-framework-core sql

Question

Can I create multiple tables using the same models with EF Core? My requirement to create multiple tables(with diff names) with the same models and they do not need to share any information. Is that possible with Entity Framework Core in asp.net core?

1
0
12/17/2018 3:53:20 PM

Popular Answer

No, you can't, and the desire to do so usually is a database design smell. Consider redesigning your table layout. Perhaps adding a column to differentiate between records can help.

See also GitHub aspnet/EntityFrameworkCore #7299: Using the same class (model) to create two tables.

1
12/17/2018 3:55:13 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow