System.Collections.Generic.IEnumerable' does not contain any definition for 'ToList'

Are you missing a using directive for System.Linq?

http://msdn.microsoft.com/en-us/library/bb342261.aspx


You're missing a reference to System.Linq.

Add

using System.Linq

to get access to the ToList() function on the current code file.


To give a little bit of information over why this is necessary, Enumerable.ToList<TSource> is an extension method. Extension methods are defined outside the original class that it targets. In this case, the extension method is defined on System.Linq namespace.


An alternative to adding LINQ would be to use this code instead:

List<Pax_Detail> paxList = new List<Pax_Detail>(pax);