<<назад Course.vb (Contoso University).
1: #Const Type = "Final"
2: '#Const Type = "Intro"
3:
4: #If Type = "Intro" Then
5: #Region "snippet_Intro"
6:
7: Imports System.Collections.Generic
8: Imports System.ComponentModel.DataAnnotations
9: Imports System.ComponentModel.DataAnnotations.Schema
10:
11: Namespace Models
12:
13: Public Class Course
14:
15: <DatabaseGenerated(DatabaseGeneratedOption.None)>
16: Public Property CourseID As Integer
17:
18: Public Property Title As String
19:
20: Public Property Credits As Integer
21:
22: Public Property Enrollments As ICollection(Of Enrollment)
23: End Class
24:
25: End Namespace
26: #End Region
27:
28: #ElseIf Type = "Final" Then
29:
30: #Region "snippet_Final"
31:
32: Imports System.Collections.Generic
33: Imports System.ComponentModel.DataAnnotations
34: Imports System.ComponentModel.DataAnnotations.Schema
35:
36: Namespace Models
37:
38: Public Class Course
39:
40: <DatabaseGenerated(DatabaseGeneratedOption.None)>
41: <Display(Name:="Number")>
42: Public Property CourseID As Integer
43:
44: <StringLength(50, MinimumLength:=3)>
45: Public Property Title As String
46:
47: <Range(0, 5)>
48: Public Property Credits As Integer
49:
50: Public Property DepartmentID As Integer
51:
52: Public Property Department As Department
53:
54: Public Property Enrollments As ICollection(Of Enrollment)
55:
56: Public Property CourseAssignments As ICollection(Of CourseAssignment)
57: End Class
58: End Namespace
59:
60: #End Region
61:
62: #End If
Comments (
)
Link to this page:
//www.vb-net.com/EF-missing-FAQ/Code/Course.vb.htm
|