title: Can I have an interface parameter, pass by reference?
body: <p>I have a method with this signature:</p>
  
  <pre><code>protected bool MyMethod (ref IMyInterface model) {
      // stuff and things
  }
  </code></pre>
  
  <p>I have a model that I'm passing in from this class: </p>
  
  <pre><code>public class MyClass: IMyInterface {
      // class stuff and things
  }
  </code></pre>
  
  <p>I'm trying to pass my model into the method like so:</p>
  
  <pre><code>var model = new MyClass():
  
  MyMethod(ref model);
  </code></pre>
  
  <p>However, I get an error about the type not matching the parameter type. If I don't pass by reference, it works fine. Or, if I cast it and pass it like so, it works fine.</p>
  
  <pre><code>var tempModel = (IMyInterface)model;
  
  MyMethod(ref tempModel);
  </code></pre>
  
  <p>I'd rather avoid a cast if it's not necessary, but I can't pass without it. I thought if the class implemented the interface, I could pass the model. Is it just not a thing I can do by reference or am I missing something?</p>