<<назад 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 (
)
<00>
<01>
<02>
<03>
<04>
<05>
<06>
<07>
<08>
<09>
<10>
<11>
<12>
<13>
<14>
<15>
<16>
<17>
<18>
<19>
<20>
<21>
<22>
<23>
Link to this page:
//www.vb-net.com/EF-missing-FAQ/Code/Person.vb.htm
<SITEMAP> <MVC> <ASP> <NET> <DATA> <KIOSK> <FLEX> <SQL> <NOTES> <LINUX> <MONO> <FREEWARE> <DOCS> <ENG> <CHAT ME> <ABOUT ME> < THANKS ME> |