Frequently used annotations
Frequently used data annotations
Below or some of the frequently used annotations in order to configure the entities the way we want
Index
You can specify an index over a column as follows:
Index uniqueness
You can make an index unique as follows:
Column names
If you prefer to configure your columns with different names, you can do so as following code snippet:
Maximum length
In the following example, configuring a maximum length of 500 will cause a column of type nvarchar(500)
to be created on SQL Server:
Precision and Scale
Key
You can configure a single property to be the primary key of an entity as follows:
Last updated