0
|
1 using System;
|
|
2
|
|
3 using BLToolkit.Mapping;
|
|
4 using BLToolkit.Validation;
|
|
5
|
|
6 namespace BLToolkit.Demo.ObjectModel
|
|
7 {
|
|
8 [MapField("PersonID", "ID")]
|
|
9 public abstract class Person : BizEntity
|
|
10 {
|
|
11 [MaxLength(50), Required] public abstract string LastName { get; set; }
|
|
12 [MaxLength(50), Required] public abstract string FirstName { get; set; }
|
|
13 [MaxLength(50)] public abstract string MiddleName { get; set; }
|
|
14 public abstract Gender Gender { get; set; }
|
|
15
|
|
16 [MapIgnore]
|
|
17 public string FullName
|
|
18 {
|
|
19 get
|
|
20 {
|
|
21 return string.Format(
|
|
22 string.IsNullOrEmpty(MiddleName)? "{2}, {0}": "{2}, {0} {1}.",
|
|
23 FirstName, MiddleName, LastName);
|
|
24 }
|
|
25 }
|
|
26 }
|
|
27 }
|