I have a class ReportingComponent<T>
, which has the constructor:
public ReportingComponent(IQueryable<T> query) {}
I have Linq Query against the Northwind Database,
var query = context.Order_Details.Select(a => new
{
a.OrderID,
a.Product.ProductName,
a.Order.OrderDate
});
Query is of type IQueryable<a'>
, where a' is an anonymous type.
I want to pass query to ReportingComponent to create a new instance.
What is the best way to do this?
Kind regards.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…