Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Page History: SQL Statement used by LINQ

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: Wed, Nov 24, 2010, 7:44 AM


To send it to the Console.

using (NorthwindDataContext context = new NorthwindDataContext())
{          
    context.Log = Console.Out;

    Customer customer = context.Customers.Single<Customer>
                       (c => c.CustomerID.Equals("ALFKI"));
}

To send it to the debugger output window. (DebuggerWriter is a wrapper around System.Diagnostics.Debugger.
using (NorthwindDataContext context = new NorthwindDataContext())
{          
    context.Log = new DebuggerWriter();

    Customer customer = context.Customers.Single<Customer>
                        (c => c.CustomerID.Equals("ALFKI"));
}

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.