I have three entities:
BaseEntity (Guid Id) Primary key (for all entities)
Person (Name, FamilyName) : BaseEntity
Employee (Salary) : Person
How to map Employee so that its Primary key was also a foreign key for Person?
- Should I inherit from Person in Employee class?
- Or maybe I should both classes: Person and Employee inherits from BaseEntity and in Employee Add property: Person?
Anyway I was trying to achieve the first option. Is it possible?
EDIT
I am using auto mapper (FluentNHibernate.Automapping). I wanted here to achieve inheritance per type. That Both entities have their tables: Person (with Id, name, familyname) and Employee (id, salary)