0

在使用 linq to entity 查询具有多对多关系的表时,我需要帮助。下面是我的场景:在下面的场景中,每个 BName(来自表 2)在表 3 中可以有多个值,那么如何使用 linq to entity 进行查询?得到最后提到的以下类结构的格式。

表 1:entityA:列:entityAId | 姓名 | 描述

表 2:entityB:列:entityBId | B名称 | 描述

多对多关系表 表 3:entityC:列:entityCId | 实体ID | 实体BId | 价值

public class TempClassA //Corresponds to Table 1
{
    public string AName { get; set; }
    public string Description { get; set; }
    public List<TempCLassB> lstTempClassB { get; set; } 
}

public class TempCLassB //Corresponds to Table 2
{
    public string BName { get; set; }
    public List<String> Values { get; set; }  //Corresponds to Table 3
}
4

0 回答 0