title: Cannot implicitly convert type 'System.Collections.Generic.List< >' to 'System.Collections.Generic.IList< >'
body: <p>There are lots of possible duplicates for this post.But i tried most of thems, unfortunately my error still
  happens.</p>
  
  <blockquote>
    <p>Error is : Error  1   Cannot implicitly convert type <code>'System.Collections.Generic.List&lt;Report.Business.ViewModels.InvoiceMaster&gt;'</code> to <code>'System.Collections.Generic.IList&lt;ICSNew.Data.InvoiceHD&gt;'</code>. An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <pre><code>public IList&lt;InvoiceHD&gt; GetAllInvoiceMasterDetailsByInvoiceId(int InvoiceId)
  {
      var dbMstDtl = ireportrepository.GetAllInvoiceMasterDetailsByInvoiceId(InvoiceId);
  
      var MstDtl = from mst in dbMstDtl 
                   select new Report.Business.ViewModels.InvoiceMaster 
                   {
                       ModifiedDate = mst.ModifiedDate,
                       SubTotal = Convert.ToDecimal(mst.SubTotal),
                       TotalDiscount = Convert.ToDecimal(mst.TotalDiscount),
                       VAT = Convert.ToDecimal(mst.VAT),
                       NBT = Convert.ToDecimal(mst.NBT),
                       AmtAfterDiscount = Convert.ToDecimal(mst.AmtAfterDiscount)
                   };
  
      return MstDtl.ToList();
  }
  </code></pre>
  
  <p>In some post i saw this thing solved when they use  <strong>return MstDtl.AsEnumerable().ToList();</strong></p>
  
  <p>But in my case it also not working(getting errors)</p>