-
Notifications
You must be signed in to change notification settings - Fork 1
/
Person.cs
31 lines (25 loc) · 864 Bytes
/
Person.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
using System;
using System.ComponentModel.DataAnnotations;
namespace Sample.Models {
public class Person {
public Person() {
PersonID = 0;
FirstName = string.Empty;
MiddleName = string.Empty;
LastName = string.Empty;
}
public Person(int id, String firstName, string middleName, String lastName) {
this.PersonID = id;
this.FirstName = firstName;
this.MiddleName = middleName;
this.LastName = lastName;
}
[Key]
public int PersonID { get; set; }
[Required(ErrorMessage = "First Name is required")]
public string FirstName { get; set; }
public string MiddleName { get; set; }
[Required(ErrorMessage = "Last Name is required")]
public string LastName { get; set; }
}
}