Skip to content

How to implement Unique Attribute in property/field #5408

Answered by minhhungit
harifenny asked this question in Help
Discussion options

You must be logged in to vote

It has UniqueConstraint attribute, put it on your row class, like this

[UniqueConstraint(new[] { "SupplierId", "OemNumber", "StockNumber", "YardLocation" })] 
public sealed class InventoryStoreRow : Row, IIdRow, INameRow { 
  [DisplayName("Id"), Identity] 
  public Int32? Id { 
    get { return Fields.Id[this]; } 
    set { Fields.Id[this] = value; } 
  }
}

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@harifenny
Comment options

@harifenny
Comment options

@minhhungit
Comment options

@minhhungit
Comment options

@harifenny
Comment options

Answer selected by harifenny
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants