title: A method which call an external Api return an interface
body: <p>I use restsharp to consume an external API.
  I have a class that extends the interface</p>
  
  <pre><code>public interface ICarInfo
  {
      ICarDetails GetCarInfo(string car);
  }
  
  public interface ICarDetails
  {
      string Color { get; set; }
      string MaxSpeed { get; set; }
      string Acceleration{ get; set; }
  
  }
  </code></pre>
  
  <p>I create the class which extends this interface and implement this method using restsharp</p>
  
  <pre><code>public ICarDetails GetCarInfo(string car)
      {
          var client = new RestClient("http://xxx.xxxxxxx.com");
          var request = new RestRequest("/{car} ? access_key =xxxxxxxxx", Method.GET);
          var queryResult = client.Get&lt;ICarDetails &gt;(request).Data;
          return queryResult;
      }
  </code></pre>
  
  <p>Now i get an error in this line: </p>
  
  <pre><code>var queryResult = client.Get&lt;ICarDetails &gt;(request).Data;
  </code></pre>
  
  <blockquote>
    <p>ICarDetails must be a non-abstract type with a public parameterless
    constructor in order to use it as a parameter T in the generic type or
    method</p>
  </blockquote>