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
|
Just tried to switch to LS 3, but got a bug in existing code. |
|
|
Thanks for reporting this. This isn't actually a dynamic LINQ issue. Rather, it is a bug in the way we handle Where clauses that appear after a projection, i.e. where the properties in the Where clause are defined on the projected type (ProductDto) rather than on the entity type (Product). Thus, if you invert the order of the Where and Select clauses: query.Where("CreatedAt < @0", DateTime.Now).Select(ProductDto.GetLinqMapBLOCKED EXPRESSION; it will work (at least it does in our test environment). This may give you a workaround until we can get the issue fixed. |
|
|
Community Server FAIL. Where is says GetLinqMapBLOCKED EXPRESSION, that should be your GetLinqMapExpression function, plus all the required brackets to make it lovely. Hope it makes more sense now... |
|
|
Hello Marko, Okay, it seems we had a bug when you projected into a named (not anonymous) type and then queried on the projected properties. I've now committed a fix for this. We're not automatically publishing nightly builds yet so if you want to get your hands on this fix let us know and we'll push it up for you. Thanks again for reporting this issue! |
|
|
Hi Ivan, I will try inverting the queries (fortunately, all are dynamically created from one generic method), but in start I am not sure about a potential pitfall. All queries are generated according to client request which knows only about projection properties. Will this workaround work in case projection's property names are different from entity's property names? Not sure if we do have this kind of situation, a lot of classes are already existing. If it fails, I'll let you know. Anyway, as I said in another topic, we've just decided to squeeze in LS 3 for this project, so the more time we have testing the latest version, the better for us. So, will be looking forward on that build update. |
|
|
OK, the workaround immediately failed for me on the test example, as I have DTO projection property "CreatedAtTime" and entity property "CreatedAt". So, it will not work for us for sure when projection has properties with different names from original ones, as we are dynamically creating where conditions according to projection properties (client is aware only of these). A lot of DTO-projection classes already existing and client code depending on it, so cheking all and possibly changing is a bit of time consuming, so for sure we would appriciate a version update of LS 3. Thanks. |
|
|
OK, I should stop writing posts from home, and write when I come to work. :) |
|
|
Hello Marko, The latest build is now available for you to download from the store. Please let us know if you still see problems. |
|
|
Hi Ivan. Picked up the build, issue resolved. Looking forward to using new features from LS 3. |
|