I am struggling for the last couple of days on an idea of how to model these entities in EF. So I decided to ask the community to lend a hand. :-) The core classes are given below.
class BaseEntity
{
long Id;
DateTime DateCreated;
}
class Person : BaseEntity
{
string Name;
string Address;
}
class Taxpayer : Person
{
string TaxpayerIdentificationNumber;
double Income;
Taxpayer(or Person) Spouse;
}
class Client : BaseEntity
{
string CustomerId;
string ContactNumber;
}
class Partnership : Client
{
List<Taxpayer (or Person)> Partners;
}
class Company : Client
{
string CompanyRegistrationNumber;
}
The scenario is, a Client can be one of the 3 types i.e. Taxpayer, Partnership, Company (Specialization/IsA).
The problem is, in the case of the Taxpayer class he should inherit both the properties of Client and Person classes. (UPDATE: A taxpayer can be a client but not necessarily) Also in the other places Taxpayer class is used, most of the time it can be either a Person class or Taxpayer class.
Any ideas on how to proceed?
Thanks.