LinqPad 6 with System.Data.Linq.Table
I have the code below that works in Linqpad 5. How can I recreate this code in Linqpad 6?
The 'System.Data.Linq.Table' produces an error:
CS0234 The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
public static void SerializeToFile<T>(this System.Data.Linq.Table<T> source, string filename, Expression<Func<T, bool>> predicate = null) where T: class { var entities = ((predicate == null) ? source : source.Where(predicate)).ToList(); var xSer = new XmlSerializer(typeof(List<T>)); using (var wrt = new StreamWriter(filename)) { xSer.Serialize(wrt, entities); } }
Any suggestions?
Thanks
Comments
Press F4 and select Reference LINQ to SQL assemblies at the bottom right.
As I understand it, if you are using a Linq to SQL Data Connection in your query, then this is included automatically.