Back to Devexpress

LinqServerModeDataSourceSelectEventArgs.KeyExpression Property

aspnet-devexpress-dot-data-dot-linq-dot-linqservermodedatasourceselecteventargs.md

latest1.6 KB
Original Source

LinqServerModeDataSourceSelectEventArgs.KeyExpression Property

Gets or sets the key expression.

Namespace : DevExpress.Data.Linq

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public string KeyExpression { get; set; }
vb
Public Property KeyExpression As String

Property Value

TypeDescription
String

Specifies the name of the key property.

|

Remarks

Example

The following example illustrates how to use the KeyExpression property.

csharp
protected void EntityServerModeDataSource1_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e) {
    var db = new YourDataContext();
    e.KeyExpression = "ID_FIELD_FROM_YOUR_TABLE";
    e.QueryableSource = db.Products;
    //or
    e.QueryableSource = db.Products.Where(p=>p.Price > 10);
    //or other linq query
}

See Also

LinqServerModeDataSourceSelectEventArgs Class

LinqServerModeDataSourceSelectEventArgs Members

DevExpress.Data.Linq Namespace