Support for dynamic properties added through System.ComponentModel
I am using a third party ORM (Telerik DataAccess) and have the following use case:
I've implemented a custom TypeDescriptionProvider in order to add dynamic fields to some of my model types. These fields are stored in the database as regular fields(they have columns) and are available for reading, querying, updating through Linq Expressions that the underlying ORM understands. This functionality is available in the Telerik DataAccess ORM -> link. A sample code in Linq looks like:
context.GetAll
I've exposed these fields by manually adding them to the EdmModel. I have implemented the custom retrieval of data and I am able to convert the data comming from the ORM to the EdmEntityTypes and return them from the server. I am also using the OdataQueryOptions when filtering, sorting and querying items, because I would like to take advantage of the full functionality of the Odata query syntax. Telerik DataAccess supports most of the linq expressions generated by the ODataQueryOptions class. However it does not support filtering or sorting by these fields (added through System.Compontent model), because the FilterBinder searches through reflection for the properties that are being queried.
The method that does this is called CreatePropertyAccessExpression and is located in the FilterBinder class and this is the code that does the work: Expression propertyAccessExpression = Expression.Property(RemoveInnerNullPropagation(source), propertyName);
I would like to be able to query those properties and build the expression for accessing them myself.