小编ear*_*xtr的帖子

lambda表达式通过集合查询集合

我想创建一个lambda表达式来按集合查询集合

在EF代码优先环境中,我有以下数据对象

我有一个名为price的课程

public class Price
{
    public int Id { get; set; }
    public string DisplayName { get; set; }
    public double Amount { get; set; }
    public bool IsActive { get; set; }

    public int ItemId { get; set; }
    [ForeignKey("ItemId")]
    public virtual  Item Item  { get; set; }

    public ICollection<PriceOption> PriceOptions { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

还有一个名为的相关类

public class PriceOption
{
    public int Id { get; set; }


    public int PriceId { get; set; }
    [ForeignKey("PriceId")]
    public …
Run Code Online (Sandbox Code Playgroud)

c# linq lambda

5
推荐指数
1
解决办法
3207
查看次数

标签 统计

c# ×1

lambda ×1

linq ×1