(MVC) MVC (2018)

<<назад Enrollment.vb (Contoso University).

   1:  #Const Type = "Final"
   2:  '#Const Type = "Intro"
   3:   
   4:  #If Type = "Intro" Then
   5:   
   6:  #Region "snippet_Intro"
   7:   
   8:  Imports System.ComponentModel.DataAnnotations
   9:  Imports System.ComponentModel.DataAnnotations.Schema
  10:   
  11:  Namespace Models
  12:   
  13:      Public Enum Grade
  14:          A
  15:          B
  16:          C
  17:          D
  18:          F
  19:      End Enum
  20:   
  21:      Public Class Enrollment
  22:   
  23:          Public Property EnrollmentID As Integer
  24:   
  25:          Public Property CourseID As Integer
  26:   
  27:          Public Property StudentID As Integer
  28:   
  29:          Public Property Grade As Grade?
  30:   
  31:          Public Property Course As Course
  32:   
  33:          Public Property Student As Student
  34:      End Class
  35:   
  36:  End Namespace
  37:   
  38:  #End Region
  39:   
  40:  #ElseIf Type = "Final" Then
  41:   
  42:  #Region "snippet_Final"
  43:   
  44:  Imports System.ComponentModel.DataAnnotations
  45:  Imports System.ComponentModel.DataAnnotations.Schema
  46:   
  47:  Namespace Models
  48:   
  49:      Public Enum Grade
  50:          A
  51:          B
  52:          C
  53:          D
  54:          F
  55:      End Enum
  56:   
  57:      Public Class Enrollment
  58:   
  59:          Public Property EnrollmentID As Integer
  60:   
  61:          Public Property CourseID As Integer
  62:   
  63:          Public Property StudentID As Integer
  64:   
  65:          <DisplayFormat(NullDisplayText:="No grade")>
  66:          Public Property Grade As Grade?
  67:   
  68:          Public Property Course As Course
  69:   
  70:          Public Property Student As Student
  71:      End Class
  72:  End Namespace
  73:   
  74:  #End Region
  75:   
  76:  #End If


Comments ( )
Link to this page: //www.vb-net.com/EF-missing-FAQ/Code/Enrollment.vb.htm
< THANKS ME>