Skip to main content
.NET Framework 4.6.2+

XPQueryExtensions.QueryInTransaction<T>(Session) Method

Creates a new XPQuery<T> instance with the InTransaction (XPQuery<T>.InTransaction) mode enabled, from a specified session’s scope.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.2.dll

Declaration

public static XPQuery<T> QueryInTransaction<T>(
    this Session session
)

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.

Type Parameters

Name
T

Returns

Type Description
XPQuery<T>

An XPQuery<T> object, instantiated from the session‘s scope, with the InTransaction mode enabled.

Remarks

Example:

using System.Linq;
using DevExpress.Xpo;

// ...

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