0

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?

  1. Should I inherit from Person in Employee class?
  2. 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)

John
  • 1,834
  • 5
  • 32
  • 60

0 Answers0