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 the following function: public IQueryable<State> FindAvailableStates() In my MVC controller I have the following code: FindStatesAvailable().Select( The SQL trace shows all columns of both table s and ss. Is there a way to return just the two column shown in the projection rather than all columns from the join?
Thanks. |
|
|
If you update to the latest nightly build you will find we have recently added in support for passing down these projections to the server in multi entity scenarios where it is possible for us to do so. This should cover your query above.
Jeremy |
|
|
Thank you. |
|
|
I just ran a quick test and it doesn't seem to be producing SQL that's any different. I'm using LightSpeed v3.0.1009.12888. This is what's coming across the profiler: exec sp_executesql N'SELECT
|
|
|
Ah, indeed. That is because you have a chained select there which is a different expression tree altogether ;) Ive added in some additional checks which should cover this into the latest nightly build (20100128 and above) if you are able to review that. Unfortunately the nature of handling LINQ expressions and the associated projection chain means that we have to assume we can't handle it natively unless we check for cases in which we can. If you have other examples where you believe it should be handled but isn't, let us know and we can review them.
Jeremy |
|