This example presents the
Generic Metadata Access API of
Telerik OpenAccess ORM mixed with the
artificial field functionality of OpenAccess. Artificial fields are fields that extend the structure
of a persistent class by adding new persistent fields during runtime. These new fields are described in XML
configuration entries. They are accessible via the Generic Metadata Access which is based on the
System.ComponentModel API and adds OpenAccess specific functionality.
All the fields of a persistent class including the artificial are accessable via property descriptors
that can be obtained using the IPersistentTypeDescriptor interface which implements the ICustomTypeDescriptor.
In this sample we use the Person persistent class which has two fields:
firstName and
lastName.
It is extended with two artificial fields -
age and
address - that are described in the app.config.
When adding new records we set the values of those fields using the Generic Metadata Access API.