hoofedear
✅ I want to get duplicate items in my List (EF Core)
I am trying to get a list of Cards from my database, and I am able to successfully get a List of Guids, where there are duplicate values, but when I try to use an efficient .Where() using .Contains(), it only returns 1 of the Card that shows up multiple times in the list. Here is my code:
cardList
is a List<Card>
, and originally my code did a foreach loop over the List of Guids, but that caused a lot of DB queries, so I found that doing .Contains helps, and it works fine, except it doesn't add duplicates, when I want it to.
Hope this makes sense! Thanks!49 replies