define abstract type (entity & complex) without any properties.
define derived entity types with their own keys.
Let’s see some examples:
Entity type example:
The CLR model is shown as below:
We can use the following codes to build Edm Model:
Then, we can get the metadata document for Animal as:
Note:
Animal is an abstract entity type without any keys and any properties
Dog & Pig are two sub entity types derived from Animal with own keys.
However, it’s obvious that abstract entity type without keys can’t be used to define any navigation sources (entity set or singleton).
So, if you try to:
you will get the following exception:
Complex type example
Let’s see a complex example. The CLR model is shown as below:
We can use the following codes to build Edm Model:
Then, we can get the metadata document for Graph as:
Where, Graph is an abstract complex type without any properties.