My select returns joined data from db where for every object there are several attributes. For every attribute of the object I have a new row.
I use Entity Framework to retrieve the data.
var products = _ctx.ExecuteFunction<GetProducts_Result>("GetProducts");
GetProducts is a stored proc that returns following result.
Code | Name | Term | Rate
--------+------+------+-----
111 | Foo | 12 | 10
111 | Foo | 24 | 12
111 | Foo | 36 | 16
222 | Boo | 12 | 8
222 | Boo | 24 | 9
How I can efficiently query data with linq and map to a class like
class Product
{
int Code
string Name
List<Term> terms;
}
Where Term is a class with parameters (Term, Rate)
1 Answer