Let us say my Customer class has an Orders collection. What I would like to do (in some situations) is to access the Orders collection as a Datatable, without doing much further coding. (And also without first hydrating the entire orders collection from the database and then creating the datatable. The goal is to query the database for only those fields of the Order table that I am interested in). Is this possible?
It seems like the Orders.GetMultiAsDatatable() method wants a bunch of parameters, and all I want to do is to return a datatable containing this customers orders without having to reconstruct the query. So in pseudocode
dim cust as CustomerEntity = new CustomerEntity(100)
//Now instead of
cust .Orders
//I want:
cust.GetOrdersAsDatatable(New IEntityField() {OrderFields.OrderId, OrderFields.Date})
in order to get an orders datatable containing only 2 fields that I want.
We are looking for something like this in order to solve a specific performance problem, which we believe is being caused by fetching collections of objects that have too many fields, where we really want only 2 or 3 columns.