Hello
I have a problem with many-to-many relation on EF4 and npgsql provider.
I have 3 tables: Order, OrderStatus and OrderStatusDict (dictionary). OrderStatus is some kind of changeLog - every order's status change is added to the OrderStatus table with its actual date and new status. I need to get all orders, which status.OrderStatusDict.OrderStatusName == "Pending", so im doing this this way:
var lst = (from o in db.Order
where o.OrderStatus
.OrderByDescending(s => s.Date)
.FirstOrDefault()
.OrdereStatusDict.OrderStatusName == "Pending"
select o).ToList();
And I get an exception:
An error occurred while preparing the command definition. See the inner exception for details. Data:{System.Collections.ListDictionaryInternal} Inner exception: {"The method or operation is not implemented."}
And it looks that OrderByDescending kills my query, cause if I comment
.OrderByDescending(s => s.Date)
Everything works fine, but I get the oldest OrderStatus from db :/
Can u help me? Is this a provider's cause or EF problem? Do you have any ideas I could gain this other way?