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
|
When using a parent / child relationship where both parent and child are marked to be "soft deleted" coupled with retrieval by a Linq expression, the SQL emitted incorporates RowNumber <= 1 into the output SQL in some odd ways and it has a net effect of not retrieving children that should have been retrieved as per the query. Note that this doesn't seem to consistently occur when using the FindOne syntax and it doesn't occur when Soft Deletes are turned off. Attached is a repro. We are having to work around this for the moment by ripping out some Linq code in our repositories to replace with LightSpeed query syntax. Please let me know if you guys are able to resolve this as our preference is to use Linq syntax. |
|
|
This appears to be a core paging issue. The LINQ FirstOrDefault operator emits a Page.Limit on the query in order to restrict the result set and this is being emitted into the generated SQL in the way you have observed. We are looking into this but to work around it without throwing out the LINQ syntax, changing: (from ... where activity.Id == id select activity).FirstOrDefault() to (from ... where activity.Id == id select activity).AsEnumerable().FirstOrDefault() should address the problem (and will not be inefficient because it only pulls back one record anyway). |
|
|
There'll be a fix for this in the 2 September nightly. Thanks for letting us know about this and for the detailed repro. As always, please let us know if you still see problems. |
|