Delete duplicates using Lambda

后端 未结 4 1558
南笙
南笙 2021-01-23 01:23

I need some help using a lambda expression to remove duplicate entries in my Entity Framework context. I have a table with the following columns:

Id, DateOfIncide

4条回答
  •  悲哀的现实
    2021-01-23 02:02

    You will need to use the Distinct function and if you want to just some of the fields then you need to create an Equality Comparer. (IEqualityComparer)

    Ahh just seen the comment above, check this out for more:

    Remove duplicates in the list using linq

提交回复
热议问题