July 2015
Intermediate to advanced
1300 pages
87h 27m
English
As you learned previously, with the Code First approach you define entities and associations in code. Let’s provide a simple example, in which you implement business objects like an Author class and a Book class representing two entities. Listing 26.7 shows how to define both entities.
LISTING 26.7 Coding Two Entities in Code First
Public Class Author Public Property AuthorId As Integer Public Property FirstName As String Public Property LastName As String Public Property Books As ICollection(Of Book)End ClassPublic Class Book Public Property BookId As Integer Public Property Title As String Public Property Author As Author Public Property ISBN As String Public Property ...