• ORM Open Access Demo
  • ASP.NET Ajax Demo
  • Extensions for ASP.NET MVC
  • Silverlight Demo
  • WPF Demo
  • Reporting Demo
  • Visit Telerik site
Q1 2010 (v2010.1.310, 10 March 2010) release history
Vote
+4

Generic Metadata Access and Artificial Fields API

addressagefirstNameidlastName
asdsadsad0asdada1asdasd
asdsadsad0asdada2asdasd
ASDF0fADSF3FASDF
ASDF0fADSF4FASDF
 0 5 
 0 6 
 0 7 
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.