Can't use .Where or .Select with stored procedure call?
When trying to use common LINQ methods such as .Where or .Select with a stored procedure call I get the error message "'LINQPad.ReturnDataSet' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'LINQPad.ReturnDataSet' could be found (press F4 to add a using directive or assembly reference)". The same LINQ command in C# itself works fine. The stored procedure apparently returns a DataSet with one DataTable in it but I don't have to do anything special to deal with that in C#. But LinqPad is a different story. What am I doing wrong?
Comments
spCustomers().AsDynamic().Where (x => x.Name.StartsWith ("T"))
AsDynamic is an extension method built into LINQPad that allows you to query the (untyped) output of stored procedures using dynamic typing.