title: How to cast from a concrete class to an interface type?
body: <p>I am building a multi layered application.</p>
  
  <p>When i pass an object from my presentation layer to my business layer, i want to cast it to an interface type, because the business layer does not know of the concrete class from the presentation layer.</p>
  
  <pre><code>    public ActionResult SubmitSurvey(SurveyAnswer answers)
      {
  
          ISurveyAnswer answer = (ISurveyAnswer)answers;
  
          bc.SaveSurvey(answer);
  
          return null;
      }
  </code></pre>
  
  <p>The class <code>SurveyAnswer</code> implements the interface ISurveyAnswer</p>
  
  <p>When i check the type in the business layer:</p>
  
  <pre><code> public void SaveSurvey(ISurveyAnswer answer)
          {
              String type = answer.GetType().Name;
          }
  </code></pre>
  
  <p>the GetType().Name method returns SurveyAnswer which is the concrete class from the presentation layer. Is it supposed to do that?</p>