Validation DataAnnotation
Validation DataAnnotation
Timestamp Can be applied to a property to specify the data type of a corresponding column in the database as rowversion.
ConcurrencyCheck Can be applied to a property to specify that the corresponding column should be included in the optimistic concurrency
check.
Required Can be applied to a property to specify that the corresponding column is a NotNull column in the database.
MinLength Can be applied to a property to specify the minimum string length allowed in the corresponding column in the database.
MaxLength Can be applied to a property to specify the maximum string length allowed in the corresponding column in the database.
StringLength Can be applied to a property to specify the maximum string length allowed in the corresponding column in the database.
SYSTEM.COMPONENTMODEL.DATAANNOTATIONS.SCHEMA
ATTRIBUTES:
Attribute Description
Table Can be applied to an entity class to configure the corresponding table name and schema in the database.
Column Can be applied to a property to configure the corresponding column name, order and data type in the database.
Index Can be applied to a property to configure that the corresponding column should have an Index in the database. (EF 6.1 onwards only)
NotMapped Can be applied to a property or entity class which should be excluded from the model and should not generate a corresponding
column or table in the database.
DatabaseGenerated Can be applied to a property to configure how the underlying database should generate the value for the corresponding column e.g.
identity, computed or none.
InverseProperty Can be applied to a property to specify the inverse of a navigation property that represents the other end of the same relationship.
ComplexType Marks the class as complex type in EF 6. EF Core 2.0 does not support this attribute.
Course class to represent Course entity