This question is locked. New answers and comments are not allowed.
Hi,
I have a simple database that I have build a database model for using the Visual Designer. I've extended the model by adding a couple of properties to the partial class of one of the entities. These properties derive their values from other fields, and in one case from values in a related table.
Now I'm constructing a dynamic linq query using the Dynamic Linq library included by the Data Services Wizard. When querying based on one of the database fields, everything is fine. However if my query is based around one of the extended properties I get and InvalidOperationException when the query runs. The Exception message is:
Identifier 'HasReport' is not a parameter or variable or field of 'JTServicesDAL.JTProject'. If 'HasReport' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias.
How can I fix this? Or alternatively is there a better method to follow? The aim is to allow the user to construct a query at runtime, and this query should be able to include the extended properties. I could make them fields in the database, but given they are derived from other fields, would prefer not to do this.
Thanks,
Neil.
I have a simple database that I have build a database model for using the Visual Designer. I've extended the model by adding a couple of properties to the partial class of one of the entities. These properties derive their values from other fields, and in one case from values in a related table.
Now I'm constructing a dynamic linq query using the Dynamic Linq library included by the Data Services Wizard. When querying based on one of the database fields, everything is fine. However if my query is based around one of the extended properties I get and InvalidOperationException when the query runs. The Exception message is:
Identifier 'HasReport' is not a parameter or variable or field of 'JTServicesDAL.JTProject'. If 'HasReport' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias.
How can I fix this? Or alternatively is there a better method to follow? The aim is to allow the user to construct a query at runtime, and this query should be able to include the extended properties. I could make them fields in the database, but given they are derived from other fields, would prefer not to do this.
Thanks,
Neil.