This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have an entity Job with a simple string property JobNumber. The following query throws an exception despite being valid against an IEnumerable. var query = UnitOfWork.Query Exception: Unable to cast object of type 'Mindscape.LightSpeed.Querying.LiteralExpression' to type 'Mindscape.LightSpeed.Querying.IAttributePathExpression'. -- The array of strings and the Starts With predicate are being dynamically generated by our querying engine. I know it's possible to break up the expression tree myself into a series of ORs, but it would be great if you could support this translation. Thanks! |
|
|
Unfortunately, this is not supported because it is not readily translatable to SQL. Local sequences are generally usable only when they can be translated to SQL IN clauses, e.g. Contains. (The same limitation exists in LINQ to SQL.) Obviously, it would be better if we caught this and gave a meaningful exception rather than an internal error, but either way I'm afraid you're going to have to fall back to the 'series of ORs' solution. |
|