title: Getting the instance that called the method in C#
body: <p>I am looking for an algorithm that can get the object that called the method, within that method.</p>
  
  <p>For instance:</p>
  
  <pre><code>public class Class1 {
  
      public void Method () {
          //the question
          object a = ...;//the object that called the method (in this case object1)
          //other instructions
      }
  
  }
  
  public class Class2 {
  
      public Class2 () {
          Class1 myClass1 = new Class1();
          myClass1.Method();
      }
  
      public static void Main () {
          Class2 object1 = new Class2();
          //...
      }
  
  }
  </code></pre>
  
  <p>Is there any way to do this?</p>