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
|
Hey guys, Just got a question regarding the 1.2 release and 1 to 1 mappings. I have my own model but I looked in the docs and noticed you had an engine/car example so I'll explain my problem in terms of that but add workshop to the mix where a workshop has many cars and also has many engines. My query I want is to find all the engines in a particular workshop where they are not in a car. I currently have: Repository.Find<Engine>( If I change the Entity.Attribute("Car") to Entity.Attribute("Car.Id") == an id. I get the kind of sql I would expect so LS does know about the relationship... However when I have something like the example above I get: exec sp_executesql N'SELECT
Cheers, James |
|
|
Hi James, Try using a negated exists operator: && !Entity.Attribute("Car").Exists() Off the top of my head so if it doesn't work let me know Andrew. |
|
|
Thanks Andrew! That was spot on :-) |
|