1
我的select返回db中的数据,其中每个对象都有几个属性。对于对象的每个属性,我都有一个新行。 我使用Entity Framework来检索数据。Linq select results with duplicating rows
var products = _ctx.ExecuteFunction<GetProducts_Result>("GetProducts");
GetProducts是一个存储过程,返回以下结果。
Code | Name | Term | Rate
--------+------+------+-----
111 | Foo | 12 | 10
111 | Foo | 24 | 12
111 | Foo | 36 | 16
222 | Boo | 12 | 8
222 | Boo | 24 | 9
我怎样才能有效地与LINQ查询数据并映射到一类像
class Product
{
int Code
string Name
List<Term> terms;
}
如果期限是一个带参数的类(期限,利率)
我觉得这是缺少太多的数据。你如何得到第一个结果?顺便说一下,如果你想以这种方式获取数据,为什么你没有以这种形式将数据保存在数据库中? – gdoron
是代码+名称的主键? –