Inheritance Mapping with Fluent NHibernate

后端 未结 4 2133
既然无缘
既然无缘 2020-12-04 18:15

Given the following scenario, I want map the type hierarchy to the database schema using Fluent NHibernate.

I am using NHibernate 2.0


Type Hier

4条回答
  •  無奈伤痛
    2020-12-04 19:10

    The line of code: if (part.GetType().BaseType.Name == "JoinedSubClassPart1") can be rewritten as follows:

    part.GetType().BaseType.IsGenericType && part.GetType().BaseType.GetGenericTypeDefinition() == typeof(JoinedSubClassPart<>)
    

提交回复
热议问题