LINQ to Entities - where..in clause with multiple columns

后端 未结 12 2050
别那么骄傲
别那么骄傲 2020-12-05 18:23

I\'m trying to query data of the form with LINQ-to-EF:

class Location {
    string Country;
    string City;
    string Address;
    …
}

by

12条回答
  •  情歌与酒
    2020-12-05 19:22

    I don't think that will work for you since when you are newing up an object in the Contains method it will create a new object each time. Since those object are anonymous the way they will be compared are against their reference which will be different for each object.

    Also, look at Jacek's answer.

提交回复
热议问题