Hi Vincent, While you can have an EntityManager with multiple models pointing to different datasources, you can only query one database at the time. (You can, however, save multiple entities to multiple databases in one single transaction) So, you will need to first retrieve the customers and then query for the orders. (or vice versa) i.e var aCustomer = mgr.Customers.First(); var aCustomerOrders = mgr.Orders.Where(ord => ord.CustomerID == aCustomer.Id) .ToList(); or var myOrder = mgr.Orders.First(); var CustomerName = mgr.Customers.Where(cust => cust.Id == myOrder.CustomerID) .Select(cust => cust.CompanyName) .Distinct(); You might want to take a look at the http://drc.ideablade.com/xwiki/bin/view/Documentation/many-models-per-manager - DevForce Resource Center for more information. I've also attached a simple solution showing one EntityManager with multiple models. ( http://www.ideablade.com/forum/uploads/892/T11435.zip - uploads/892/T11435.zip ) Regards, Silvio.
|