我可以使用 EF Core 的相同模型创建多个表吗?我要求创建具有相同模型的多个表(具有差异名称),并且它们不需要共享任何信息。 ASP.NET Core 中的 Entity Framework Core 可以实现这一点吗?
最佳答案
不,你不能,这样做的愿望通常是数据库设计的味道。考虑重新设计您的表格布局。也许添加一列来区分记录会有所帮助。
另请参阅GitHub aspnet/EntityFrameworkCore #7299: Using the same class (model) to create two tables .
关于c# - 我可以在 EF core asp.net 中使用相同模型创建多个表吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53818640/