I have ThirdParty entity and two derived entities: Supplier and Customer.
I have another entity called Worker, with Supplier as a member:
public abstract class ThirdParty { }
public class Supplier : ThirdParty { }
public class Customer : ThirdParty { }
public class Worker {
public virtual string Name {get;set;}
public virtual Supplier Supplier {get;set;}
}
When I get Worker from the database using the entity framework I get the following exception:
There are no EntitySets defined for the specified entity type 'CompanyData.Supplier'. If 'CompanyData.Supplier' is a derived type, use the base type instead.
The error tells me to use ThirdParty type instead of Supplier type for the Supplier member. But I want to Supplier to be with Supplier type and not ThirdParty. How can I fix this?