The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPQueryExtensions.Query<T>(Session) Method

Creates a new XPQuery<T> instance from a specified session's scope.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public static XPQuery<T> Query<T>(
    this Session session
)
<ExtensionAttribute>
Public Shared Function Query(Of T)(
    session As Session
) As XPQuery(Of T)
public static XPQuery<T> Query<T>(
    this Session session
)
<ExtensionAttribute>
Public Shared Function Query(Of T)(
    session As Session
) As XPQuery(Of T)

Parameters

Name Type Description
session Session

A Session object or its descendant, which instantiates an XPQuery<T>. The specified session is assigned to the XPQueryBase.Session property.

Parameters

Name Type Description
session Session

A Session object or its descendant, which instantiates an XPQuery<T>. The specified session is assigned to the XPQueryBase.Session property.

Returns

Type Description
XPQuery<T>

An XPQuery<T> object instantiated from the session's scope.

Returns

Type Description
XPQuery<T>

An XPQuery<T> object instantiated from the session's scope.

Type Parameters

Name Description
T

Type Parameters

Name Description
T

Remarks

Example:


using System.Linq;
using DevExpress.Xpo;

// ...

var data = from c in session1.Query<Person>()
           where c.LastName.StartsWith("A")
           select c;
See Also