<<назад Person.vb (Contoso University).
1: Imports System.ComponentModel.DataAnnotations
2: Imports System.ComponentModel.DataAnnotations.Schema
3:
4: Namespace Models
5:
6: Public Class Person
7:
8: Public Property ID As Integer
9:
10: <Required>
11: <StringLength(50)>
12: <Display(Name:="Last Name")>
13: Public Property LastName As String
14:
15: <Required()>
16: <StringLength(50, ErrorMessage:="First name cannot be longer than 50 characters.")>
17: <Column("FirstName")>
18: <Display(Name:="First Name")>
19: Public Property FirstMidName As String
20:
21: <Display(Name:="Full Name")>
22: Public ReadOnly Property FullName As String
23: Get
24: Return LastName & ", " & FirstMidName
25: End Get
26: End Property
27:
28: End Class
29:
30: End Namespace
Comments (
)
Link to this page:
//www.vb-net.com/EF-missing-FAQ/Code/Person.vb.htm
|