I am trying to make use of the code in this question to implement a query like this:
public void LoadLive(DbConnection pConnection)
{
using (DbDataReader lReader = pConnection.ExecuteReader("..."))
{
mList.AddRange(from t in lReader select new MyObject { Name = t.GetString(0) });
}
}
When I attempt to compile this (with the extension method in place), I receive this error:
error CS1934: Could not find an implementation of the query pattern for source type 'System.Data.Common.DbDataReader'. 'Select' not found. Consider explicitly specifying the type of the range variable 't'.
Am I missing something about how this is supposed to work?