I am trying to use inherited types with EF, which has been all cool and gravy until now.
I have a base type (Person) and two types that inherit person (Employee & Customer). I run into a problem when I want a person to be an Employee and a Customer at the same time. For example:
Person person = db.Persons.Single(p => p.id == id);
if (person is Employee)
{
Console.WriteLine("Person is an employee");
}
//True only if person is Employee == false
if (person is Customer)
{
Console.WriteLine("Person is a customer");
}
If I map a Person to an Employee and a Customer, "Person is Customer" always returns false until I remove the Employee mapping from the person.
And I am not sure what that is called... but there is a table per type (Person is a table, Customer is a table, and Employee is a table in the DB).