I have orders collection that contains products collection.I'm passing some product ids as list to the method.I need to return a list of products matching with any of the id in the input list.
Do i need to use a foreach loop like this? Please advice ..
public List < ProductOrderData > ListProductsByOrderId(List < Guid > input) {
List < ProductOrderData > products = new List < ProductOrderData > ();
foreach(var id in input) {
var orders = this.Collection.AsQueryable().SelectMany(order => order.Products.Where(product => product.Id == id));
}
}
Update 3: I pass product Ids and i need to get list of products from orders that match the product Ids.

