title: how to convert list to IEnumerable?
body: <p>I have the following function in which should return an IEnumerable type?how do I convert list to IEnumerable? and return an empty IEnumerable?</p>
  
  <pre><code>public IEnumerable&lt;SoftwareImageTestPlan&gt; GetAssignedTestPlansForSPSI(int SoftwareProductID, int SoftwareImageID)
  {
      var records = _entities.tblSoftwareImageTestPlans
          .Where(x =&gt; x.SoftwareProductID == SoftwareProductID &amp;&amp; x.SoftwareImageID == SoftwareImageID)
          .ToList();
  
      if (records == null)
          return new List&lt;SoftwareImageTestPlan&gt;();
      else
          return records;
  }
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Cannot implicty convert type 'System.Collections.Generic.List&lt;....> to
    System.Collections.Generic.IEnumerable&lt;.....>.An explicit conversion
    exists(are you missing a cast?)</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/0TKUg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0TKUg.png" alt="error"></a></p>