Determining where a function is defined in C#?

Posted by templatetypedef on Stack Overflow See other posts from Stack Overflow or by templatetypedef
Published on 2011-01-08T20:40:48Z Indexed on 2011/01/08 20:54 UTC
Read the original article Hit count: 137

Filed under:
|
|

Hey all -

I am a complete novice at C# (I've never used it before) and recently needed to look over some code written in it. I spent the longest time trying to track down a nonexistent method in a class that didn't seem to be defined anywhere in the class that was using it. I later found out it was an "extension method," which I gather is a method grafted onto another class by some source.

I completely understand the rationale behind this language feature and actually think it's quite nice. However, as someone without much experience in the language, it makes it harder to look up unfamiliar methods, since the method in question could be defined anywhere.

My question is this: given an unfamiliar method call in C#, what's the best way for me to look up more info on it, given that it could be an extension method defined in an entirely separate class?

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about methods