Cannot implicitly convert type ‘System.Collections.Generic.List< >‘ to ‘System.Collections.Generic.IList< >‘
Assuming InvoiceMaster derives from or implements InvoiceHD, and that you’re using C# 4 and .NET 4 or higher, you can just use generic variance: This uses the fact that an IEnumerable<InvoiceMaster> is an IEnumerable<InvoiceHD> because IEnumerable<T> is covariant in T. Another way to solve it would be to change the declaration of MstDtl to use explicit typing: (I’d also suggest following regular C# naming, where local variables start with … Read more