Skip to main content
.NET 6.0+

IndexedAttribute.AdditionalFields Property

Gets the names of additional columns that affect index creation.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

#Declaration

public StringCollection AdditionalFields { get; }

#Property Value

Type Description
StringCollection

A collection of string values that specify the names of additional columns.

#Remarks

XPO allows you to define a multi-column index in a persistent object.

Note

XPO does not support tables with multi-column (compound) keys or indexes in ASE databases. To avoid exceptions when connecting to ASE databases containing these tables, use one-column keys or indexes.

In the example below, the IndexedAttribute is applied to the LastName property. The names of other properties are specified as the first parameter (these names are delimited with semicolons). Finally, to make the value combination of these properties unique, the IndexedAttribute.Unique parameter is set to true.

using DevExpress.Xpo;

public class Person : XPObject {
    [Indexed("FirstName;BirthDate", Unique=true)]
    public string LastName {
        get { return fLastName; }
        set { SetPropertyValue(nameof(LastName), ref fLastName, value); }
    }
    string fLastName = string.Empty;

    public string FirstName {
        get { return fFirstName; }
        set { SetPropertyValue(nameof(FirstName), ref fFirstName, value); }
    }
    string fFirstName = string.Empty;

    public DateTime BirthDate {
        get { return fBirthDate; }
        set { SetPropertyValue(nameof(BirthDate), ref fBirthDate, value); }
    }
    DateTime fBirthDate;

}

Note

Do not include the name of the Indexed attribute’s target field to the AdditionalFields list.

See Also