Linq to update a collection with values from another collection?

前端 未结 5 1191
北恋
北恋 2020-12-31 04:05

I have IQueryable baseList

and List someData

What I want to do is update attributes in some

5条回答
  •  天命终不由人
    2020-12-31 04:31

    LINQ is for querying - not for updating. That means it'll be fine to use LINQ to find the corresponding item, but for the modification you should be using iteration.

    Admittedly you might want to perform some appropriate query to get baseList into an efficient form first - e.g. a Dictionary based on the property you'll be using to find the corresponding item.

提交回复
热议问题