다음을 통해 공유


DataContext.Log Property

Gets or sets an object that will write the Collaborative Application Markup Language (CAML) query that results from the translation of the LINQ query.

Namespace:  Microsoft.SharePoint.Linq
Assembly:  Microsoft.SharePoint.Linq (in Microsoft.SharePoint.Linq.dll)

Syntax

'Declaration
Public Property Log As TextWriter
    Get
    Set
'Usage
Dim instance As DataContext
Dim value As TextWriter

value = instance.Log

instance.Log = value
public TextWriter Log { get; set; }

Property Value

Type: System.IO.TextWriter
A TextWriter that can be called to write the CAML query.

Examples

The following example shows how to set the Log property to write the CAML queries to the console in a console application:

DataContext dc = new DataContext("https://localhost");
dc.Log = Console.Out;
Dim dc As New DataContext("https://localhost")
dc.Log = Console.Out

See Also

Reference

DataContext Class

DataContext Members

Microsoft.SharePoint.Linq Namespace