I use LINQ to SQL to call a stored procedure with a single result set (I found a lot of information about processing multiple result sets, but this is not what I am doing). The result set is basically all the columns from the three tables joined together, and I have LINQ to SQL entities for these three tables. The scheme looks something like this:
- Customer 1
- Order 1
- Product 1
- Product 2
- Product 3
- Order 2
- Client 2
, 1 , 1 . , , Order Customer. 7 .
, : 2 Customer LINQ to SQL, , Order, , ?
, - (dc - LINQ to SQL DataContext)...
var options = new DataLoadOptions();
options.LoadWith<Customer>(c => c.Orders);
dc.LoadOptions = options;
var customers = from c in dc.Customers select c;
... SQL, , SQL, , , Customer . , , .
, 7 Customer (5 ), . Orders Customer, , . Product, 7 , Order lazy , .
IMultipleResults, GetResult <Customer> () GetResult <Order> () GetResult <Product> () . , , GetResult < gt() - ( , GetResult <()). GetResult <() null.
, . , - , LINQ to SQL API ( LoadsWith ).