Is the following the best way of getting a single result: Site thisSite = (from site in Query<site>.All where site.OldSiteId == 13 select site).First<site>(); You do not appear to support "Single" ? Tony Steele NeighbourNet Ltd This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by Anonymous. |
Try the following queries (they are same): Site thisSite = (from site in Query<site>.All where site.OldSiteId == 13 select site).Single(); Site thisSite = Query<site>.All.Where(site => site.OldSiteId == 13).Single(); Site thisSite = Query<site>.All.Single(site => site.OldSiteId == 13); The following exceptions may occur during execution of 'Single' method:
|
No, we do. Single must work, there are even special tests for this. I remember we did a lot to support this construct in subqueries (really non-trivial, e.g. EF does not support this).
To be checked.