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
|
Hi, I found another problem with your queries. Think of a model as simple as two classes and one one-to-one association. I will call them A and B. Depending on how you build the model one of the following queries will work and the other wont: uow.Where(a => a.B == null).ToList(); uow.Where(b => b.A == null).ToList(); I have sent you an example by email. Regards, Dennis |
|
|
Thanks for drawing our attention to this. The limitation is on querying on a one-to-one association from the end which does not contain the foreign key. This can be done using the Exists() operator but was not supported using null comparisons in LINQ. I have added support for null comparisons in LINQ and it will be included in the next nightly build. Alternatively you can use the Exists() operator with the existing build: uow.Find<Entity1>(!Entity.Attribute("B.A").Exists()); Note that we still support only null comparisons. You will still not be able to do comparisons to entity instances from the non-FK end of a one-to-one association. However it should now give you a meaningful error message in this case. |
|
|
Can you please add support for != null comparisons? |
|
|
Sorry, wasn't clear. The fix includes both == null and != null comparisons. What I meant was that it doesn't include == someOtherEntity or != someOtherEntity comparisons. |
|