-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCountry.cs
46 lines (37 loc) · 1.05 KB
/
Country.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
using System;
namespace RaGae.ModelLib
{
public class Country : ICloneable
{
private string code;
private string name;
public Country() { }
public Country(string code, string name)
{
this.Code = code;
this.Name = name;
}
public string Code
{
get => this.code;
set
{
if (string.IsNullOrWhiteSpace(value))
throw new Exception($"{nameof(Country)}:{nameof(Code)}");
this.code = value;
}
}
public string Name
{
get => this.name;
set
{
if (string.IsNullOrWhiteSpace(value))
throw new Exception($"{nameof(Country)}:{nameof(Name)}");
this.name = value;
}
}
public object Clone() => this.MemberwiseClone();
public override string ToString() => $"{this.Code}-{this.Name}";
}
}