Hi all,
I'm having an issue with writing a "real world" criteria query. What I'm trying to do is create a query across several relationships. I'll use a Northwind example for clarity sake. I want a list of all the Customers that have and order for a product in a given category, or have an order for a product from a given supplier.
I've tried doing this with aliases, but I can't get an alias to work beyond one level of the relationship. I've also tried doing this by creating a new criteria object for every relationship, but I can't get that to work with the "Or" expression.
So really I have two questions.
1) Is there anyway that I can build an alias so that I can write this?
Code:
Expression.Eq("Orders.OrderDetails.Products.Categories.Name", "Auto Parts")
2) Is there anyway that I can build an OrExpression with two ICriterion from different sub-ICriterias?
Thanks in advance,
Matt