title: How can i solve Cannot implicitly convert type System.Collections.Generic.List?
body: <p>I have this model in C#:</p>
  
  <pre><code>public class interfaceModel
  {
      public string interfacename { get; set; }
      public long  id { get; set; }
  }
  </code></pre>
  
  <p>and write this code:</p>
  
  <pre><code>public static List&lt;interfaceModel&gt; CompanyInterfaceFetch()
  {
      var database = new DataBaseDataContext();
      var companyinterface = new CompanyInterface();
  
      var interfacelist =
                  database.CompanyInterfaces.Select(x =&gt; new interfaceModel { interfacename = x.InterfaceName, id=x.id});
      return interfacelist.ToList();
  }
  
  // database model
  public class interfaceModel
  {
      public string interfacename { get; set; }
      public long id { get; set; }
  }
  </code></pre>
  
  <p>Now I write code to call that method:</p>
  
  <pre><code>public static List&lt;interfaceModel&gt; interfacefetch()
  {
      return Database.CompanyInterfaceFetch();
  }
  </code></pre>
  
  <p>but on this line:</p>
  
  <pre><code>return Database.CompanyInterfaceFetch();
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Error CS0029: Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.List</p>
  </blockquote>
  
  <p>How can I solve that problem? Thanks.</p>