-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathToCollectionClasses.cs
90 lines (74 loc) · 2.58 KB
/
ToCollectionClasses.cs
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using OfficeOpenXml.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EPPlusSamples
{
public class ToCollectionSamplePerson
{
public ToCollectionSamplePerson()
{
}
public ToCollectionSamplePerson(string firstName, string lastName, int height, DateTime birthDate)
{
FirstName = firstName;
LastName = lastName;
Height = height;
BirthDate = birthDate;
}
public string FirstName { get; set; }
public string LastName { get; set; }
public int Height { get; set; }
public DateTime BirthDate { get; set; }
}
public class ToCollectionSamplePersonAttr
{
public ToCollectionSamplePersonAttr()
{
}
public ToCollectionSamplePersonAttr(string firstName, string lastName, int height, DateTime birthDate)
{
FirstName = firstName;
LastName = lastName;
Height = height;
BirthDate = birthDate;
}
[DisplayName("The persons first name")]
public string FirstName { get; set; }
[Description("The persons last name")]
public string LastName { get; set; }
[EpplusTableColumn(Header ="Height of the person")]
public int Height { get; set; }
public DateTime BirthDate { get; set; }
}
public static class ToCollectionSampleData
{
public static IEnumerable<ToCollectionSamplePerson> Persons
{
get
{
return new List<ToCollectionSamplePerson>
{
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))
};
}
}
public static IEnumerable<ToCollectionSamplePersonAttr> PersonsWithAttributes
{
get
{
return new List<ToCollectionSamplePersonAttr>
{
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))
};
}
}
}
}