-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathToCollectionClasses.vb
More file actions
73 lines (57 loc) · 2.5 KB
/
ToCollectionClasses.vb
File metadata and controls
73 lines (57 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Imports OfficeOpenXml.Attributes
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Namespace EPPlusSamples
Public Class ToCollectionSamplePerson
Public Sub New()
End Sub
Public Sub New(ByVal firstName As String, ByVal lastName As String, ByVal height As Integer, ByVal birthDate As Date)
Me.FirstName = firstName
Me.LastName = lastName
Me.Height = height
Me.BirthDate = birthDate
End Sub
Public Property FirstName As String
Public Property LastName As String
Public Property Height As Integer
Public Property BirthDate As Date
End Class
Public Class ToCollectionSamplePersonAttr
Public Sub New()
End Sub
Public Sub New(ByVal firstName As String, ByVal lastName As String, ByVal height As Integer, ByVal birthDate As Date)
Me.FirstName = firstName
Me.LastName = lastName
Me.Height = height
Me.BirthDate = birthDate
End Sub
<DisplayName("The persons first name")>
Public Property FirstName As String
<Description("The persons last name")>
Public Property LastName As String
<EpplusTableColumn(Header:="Height of the person")>
Public Property Height As Integer
Public Property BirthDate As Date
End Class
Public Module ToCollectionSampleData
Public ReadOnly Property Persons As IEnumerable(Of ToCollectionSamplePerson)
Get
Return New List(Of ToCollectionSamplePerson) From {
New ToCollectionSamplePerson("John", "Doe", 176, New DateTime(1978, 3, 15)),
New ToCollectionSamplePerson("Sven", "Svensson", 183, New DateTime(1995, 11, 3)),
New ToCollectionSamplePerson("Jane", "Doe", 168, New DateTime(1989, 2, 26))
}
End Get
End Property
Public ReadOnly Property PersonsWithAttributes As IEnumerable(Of ToCollectionSamplePersonAttr)
Get
Return New List(Of ToCollectionSamplePersonAttr) From {
New ToCollectionSamplePersonAttr("John", "Doe", 176, New DateTime(1978, 3, 15)),
New ToCollectionSamplePersonAttr("Sven", "Svensson", 183, New DateTime(1995, 11, 3)),
New ToCollectionSamplePersonAttr("Jane", "Doe", 168, New DateTime(1989, 2, 26))
}
End Get
End Property
End Module
End Namespace