July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Data Annotations consists in decorating entities and their properties with some attributes from the System.ComponentModel.DataAnnotations and System.ComponentModel.Data-Annotations.Schema namespaces (from the System.ComponentModel.DataAnnotations.dll assembly, which is automatically referenced when you create a Code First–based model). You already saw a particular usage of data annotations when talking about data validation previously, but you can also provide additional information to types, not just validation rules. The following code demonstrates how to rewrite the Book entity using data annotations:
Imports System.ComponentModel.DataAnnotationsImports System.ComponentModel.DataAnnotations.Schema ...