2

Is there any way to see how LINQ expressions are implemented? (Eg. Union / Intersect, Where etc). That would be very helpful because sometimes LINQ executes faster than custom code and sometimes it doesn't. It would be nice to know from the beginning what to use.

I know there's also tool which allows you to see .NET System methods implementations, but i can't remember its name. Can anyone point me to that?

Thank you!

4

2 回答 2

4

I know there's also tool which allows you to see .NET System methods implementations, but i can't remember its name.

The in-memory extension methods are implemented in the System.Linq.Enumerable class in the System.Core assembly.

  • Reflector is one example of a tool that allows you to easily inspect implementation given a compiled assembly.
  • ILSpy is a free alternative.

But the .NET source code is now freely available. So don't hesitate to directly consult it.

于 2012-07-14T15:28:21.140 回答
1

使用免费的反编译器dotPeek。它也是内置在 ReSharper 中的

于 2012-07-14T15:30:52.247 回答