Linq query to exclude from a List when a property value of List of different type are equal?

后端 未结 1 623
醉酒成梦
醉酒成梦 2021-01-02 13:11

I have a List of type Fee from which I need to exclude the ones that have an ID that exists in another List of type int.

List ExcludedFeeIDs = new         


        
相关标签:
1条回答
  • 2021-01-02 13:21

    Try this:

    var MyFees = from c in ctx.Fees
                 where !ExcludedFeeIDs.Contains(c.FeeID)
                 select c;
    
    0 讨论(0)
提交回复
热议问题