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
|
Hello, Consider having two entities, namely "Application" and "SecurityToken". Application has an "IsSystem" property of type bool and SecurityToken has a "Token" of type "string". An application can have many security tokens, but a security token can only have one and only one application. Given a token, I want to the value of the "IsSystem" of the application of the security token. Here is what I have:
The SQL looks something like this:
How do I change the query so that only a single column is returned, such as:
The aim here is to prevent unnecessary data, such a blob etc from being loaded from the database, and thus reduce memory requirements and improve speed. I have several cases where performance degrades a bit, because of all the data being returned. Thanks, Werner |
|
|
FindOne always returns an entity (and therefore ignores the Projection collection). You need to use the Project method. Furthermore, you do not need to set up all the joins explicitly. You can just use a dotted path in the projection.
LightSpeed will create the required join for you, and will select only the single column specified in the Projection collection. |
|
|
That is pretty sweet. Thanks. |
|