-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.cs
More file actions
53 lines (40 loc) · 1.18 KB
/
Student.cs
File metadata and controls
53 lines (40 loc) · 1.18 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
using System;
namespace AutoMapperTest
{
public class People
{
public string IdentityId { get; set; }
public string Name { get; set; }
public DateTime Birthday { get; set; }
}
/// <summary>
/// map to the table in database
/// </summary>
public class Student : People
{
public Guid Guid { get; set; }
public string CreatedBy { get; set; }
public DateTime CreatedOn { get; set; }
public string Teacher { get; set; }
public override string ToString()
{
var reuslt=
$"{nameof(IdentityId)} = {IdentityId}, {nameof(Name)} = {Name}, {nameof(Birthday)} = {Birthday:yyyy-MM-dd}, {nameof(Teacher)} = {Teacher}";
return reuslt;
}
}
/// <summary>
/// data transfer object(Dto) which used to pass data to backend
/// </summary>
public class StudentDto
{
public string IdentityId { get; set; }
public string Name { get; set; }
public string Birthday { get; set; }
public Teacher Teacher { get; set; }
}
public class Teacher : People
{
public string Course { get; set; }
}
}