How can I query for a list of customers + the dollar amount of their last order?
I get an exception that Last() cannot be translated by the query translator. Also, I'd like a LEFT JOIN. Thus, if a customer has no orders, I'd like his LastOrderAmount to be 0. |
Apparently, the Last() method is not supported. I tried using First() and doing OrderByDescending(o => o.OrderDate) to reverse the sequence of the elements. The query executes now, but it returns the amount of the FIRST order, instead of the last. Apparently, the OrderByDescending() is not being applied.
Ara, could you specify which version of DataObjects.Net you are using? The build number will do.
4.5.0.7955
We are planning to publish the next 4.5 beta tomorrow. It will contain the fix for such issues.
Great news, thank you. Roughly in how many hours will it be released? I hate to bug you guys, but it's really urgent for us.
Ara, it might take a whole day to get it cooked and checked. I'll notify you here or you may monitor the blog for the announcement.
Ara, the beta is available for download at the website. If you use Security practice you'll also need
DataObjects.Net 4.5.0 Extensions.zip
package, it contains the latest version of Practices (which is now renamed to Extensions so you'll have to rename the namespaces in your project).