13

I need to write my own version of the Except method, or at least somehow modify how the LINQ one works. I'm comparing to large lists of custom objects, and need connect matches from list A to list B. I think Excepts hash table building is the fastest way to do the comparison, but the method will only return the non matches. I'm thinking if I can take a peek at how the method actually works, I can add the functionality I need.

Does anyone know where this resource is located?

rene
  • 41,474
  • 78
  • 114
  • 152
will
  • 837
  • 3
  • 11
  • 24

2 Answers2

23

.NET source code is open source now. You can check it on GitHub. The LINQ source is here: https://github.com/dotnet/runtime/tree/master/src/libraries/System.Linq

Also of note: How does LINQ Except work?

Rufus L
  • 36,127
  • 5
  • 30
  • 43
Bruno Brant
  • 8,226
  • 7
  • 45
  • 90
  • I am looking for the source code of `Microsoft.Azure.Functions.Worker`, how do you search by namespaces? I tried to look for `System.Linq` but without your link I would have never been able to find it.. thanks in advance! – Ama Sep 15 '21 at 20:59
  • 1
    Another place to check the source code is [here](https://source.dot.net/). @Ama, you won't find `Microsoft.Azure.Functions.Worker` in https://github.com/dotnet/runtime/tree/main/src/libraries because it isn't part of .net core it's a separate library. – stanimirsp Jun 23 '23 at 08:05
8

You can find most of the BCL source on the Reference Source site.

It sounds from your description that you should take a look at Enumerable.Intersect, however.

Charles Mager
  • 25,735
  • 2
  • 35
  • 45