Property in class is IEnumerable<TDto> get TDto.A == a
- by Miau
So I have a class is something like this
public class Order
{
//some other stuff ...
//setting the internal _orderItems collection ...
IEnumerable<OrderItems> OrderItems { get { return _orderItems; }
}
public class OrderItem
{
//other stuff
public string ProductName {get; set;}
}
If I have a collection of orders of some sort and have access via linq to the order, something like
myOrderRespository.Where(x=>x.OrderItems)
Then I only have access to getEnumerator there, waht I would like it to be able to do something like
myOrderRespository.Where(x=>x.OrderItems.ProductName == "Blah")
Is this possible?
this is a made up scenario and its pseudo code I m trying to simplify the problem so its easy to explain ( so please forgive me if there are a few errors)
Cheers