-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersonTable.cs
More file actions
54 lines (45 loc) · 1000 Bytes
/
PersonTable.cs
File metadata and controls
54 lines (45 loc) · 1000 Bytes
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
using System;
namespace DataTableMakeSample
{
enum PersonTable
{
Id,
Name,
Age
}
static class PersonTableSetting
{
public const String Id = "Id";
public const String Name = "Name";
public const String Age = "Age";
private static Type Id_Type = typeof(Int32);
private static Type Name_Type = typeof(String);
private static Type Age_Type = typeof(Int32);
public static string GetProperty(this Enum type)
{
switch (type)
{
case PersonTable.Id:
return Id;
case PersonTable.Name:
return Name;
case PersonTable.Age:
return Age;
}
return String.Empty;
}
public static Type GetPropertyType(this Enum type)
{
switch (type)
{
case PersonTable.Id:
return Id_Type;
case PersonTable.Name:
return Name_Type;
case PersonTable.Age:
return Age_Type;
}
return typeof(Object);
}
}
}