IndexedAttribute.Unique Property
In This Article
Gets or sets whether the index created by a property or field is a unique one.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
#Declaration
#Property Value
Type | Description |
---|---|
Boolean | true if the index must be unique (no two persistent objects are permitted to have the same index value); otherwise, false. |
#Remarks
public class User : XPObject {
[Indexed(Unique = true)]
public int UserId {
get { return fUserId; }
set { SetPropertyValue(nameof(UserId), ref fUserId, value); }
}
int fUserId;
public string UserName {
get { return fUserName; }
set { SetPropertyValue(nameof(UserName), ref fUserName, value); }
}
string fUserName;
}
See Also