Consider the following code:
int i = 0;
private void AddValue()
{
i++;
}
When I call AddValue method it has some method body that adds 1 in i.
Now consiter this:
ArrayList ar = new ArrayList();
When I call ar.Add(1) it adds and object 1 in ar. when I right click Add and press go to defination i see
public virtual int Add(object value);
there is no such method body that is adding 1 as object in ar i.e the ArrayList.
my Question is where the hell the method body of ArrayList.Add() is located. how the hell does it add an object to ArrayList when it seems to have no such MethodBody.
If you take a look at the code tab’s title, it’ll say
[from metadata]. It’s not the implementation you’re looking at, but “metadata that appears as C# source code in a read-only buffer”. See also: Metadata as Source.