Any database object can inherit from any other database object. The Database attribute is inherited from base- to subclasses. Hence, any class that directly or indirectly inherits a class with the Database attribute becomes a database class.
Example
In this example, both PrivateCustomer and CorporateCustomer become database classes due to them inheriting Customer:
[Database]publicclassCustomer{publicstring Name {get;set;}}publicclassPrivateCustomer:Customer{publicstring Gender {get;set;}}publicclassCorporateCustomer:Customer{publicstring VatNumber {get;set;}}
The table Customer will contain all PrivateCustomers and all CorporateCustomers. So if there is a private customer called "Goldman, Carl" and a corporate customer called "Goldman Sachs", the result of SELECT C FROM Customer c will contain both of them.
Base Classes
A base class contains all instances of all derived classes in addition to the instances with the its own exact type.