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 want to compare the result of a FunctionExpression with a value. PathExpression.BuildExpression allows a RelationalOperator but must take a PathExpression, which FunctionExpression is not. How do I compare a QueryExpression with a value using a RelationalOperator? |
|
|
Ideally, use LINQ. The core API for working with functions is designed primarily to support the LINQ provider, and isn't very friendly to work with directly. However, if that isn't an option, then use PathExpression.Function. A FunctionExpression isn't something that stands alone, it has to be applied to something. So rather than constructing a FunctionExpression yourself, you let LightSpeed create one for you and apply it to your PathExpression: somePath.Function("LEN") > 10 or using the BuildExpression API: BuildExpression( |
|
|
This is a tweak to a page that heavily uses the core API to generate dynamic queries. Changing to LINQ isn't an option. Will the Function method work with coalesce and multiple paths? The additional parameters it takes are values. I want to generate something like this: select * from mytable t where coalesce(t.lastupdateddate, t.createddate) > '1/2/2010' |
|
|
I haven't tested your specific scenario, but the Function method can take arguments, and I'm pretty sure these can be PathExpressions: Entity.Attribute("LastUpdatedDate") |
|
|
Yup just tried that and it works. Thanks for your help. |
|