How can I get linqpad to understand CreateSourceQuery in the following C# statements?
var airline = Airlines.FirstOrDefault(a => a.ID == 1776);
airline.Dump();
var crew = airline.Crew.CreateSourceQuery().Where(c => c.Title == "pilot");
crew.Dump();
Where Airlines.Crew is a navigation property. Linqpad gives the error:
‘System.Data.Linq.EntitySet’ does not contain a
definition for ‘CreateSourceQuery’ and no extension method
‘CreateSourceQuery’ accepting a first argument of type
‘System.Data.Linq.EntitySet’ could be found
Is this perhaps just a reference I need?
CreateSourceQueryis an Entity Framework method. LINQPad uses LINQ-2-SQL by default.There’s a walk-through on the LINQPad website which explains how to use it with Entity Framework:
http://www.linqpad.net/EntityFramework.aspx