Modelling polymorphic associations database-first vs code-first

后端 未结 1 1045
粉色の甜心
粉色の甜心 2020-11-30 08:05

We have a database in which one table contains records that can be child to several other tables. It has a \"soft\" foreign key consisting of the owner\'s Id and a table nam

相关标签:
1条回答
  • 2020-11-30 08:17

    I personally stick with Database first when using EF on any schema that is this level of complexity. I have had issues with complex schemas in regards to code first. Maybe the newer versions are a little better, but worrying how to try and code complex relationships seems less straight forward then allowing the engine to generate it for you. Also when a relationship gets this complex I tend to avoid trying to generate it with EF and try and use stored procedures for easier troubleshooting of performance bottlenecks that can arise.

    0 讨论(0)
提交回复
热议问题