Compare Page Revisions
« Older Revision - Back to Page History - Current Revision
using (NorthwindDataContext context = new NorthwindDataContext()) { context.Log = Console.Out; Customer customer = context.Customers.Single<Customer> (c => c.CustomerID.Equals("ALFKI")); }
using (NorthwindDataContext context = new NorthwindDataContext()) { context.Log = new DebuggerWriter(); Customer customer = context.Customers.Single<Customer> (c => c.CustomerID.Equals("ALFKI")); }
IQueryable<Product> q = from o in . . . string sql = ((ObjectQuery<Product>)q).ToTraceString();
DebugSql
IQueryable
public static class Extender { public static void DebugSql(this IQueryable q) { var o = q as ObjectQuery; if (o == null) return; Debug.Print("=".PadLeft(100, '=')); Debug.Print(o.ToTraceString()); } }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.