Fluent NHibernate mapping: one table, many classes
-
05-07-2019 - |
Question
How would I go about mapping three classes to one table with fluent NHibernate. A "Type" column should indicate which class should be mapped. Is it even possble?
- Kristoffer
Solution
It's certainly possible, assuming that your classes extend a common base class. This is called table-per-class strategy and instructions on how to map it are in the documentation.
OTHER TIPS
Are you in a situation where your data could be normalized? What you're trying to do seems like a dead giveaway that this is the actual problem.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow