-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCustomerId.cs
34 lines (29 loc) · 861 Bytes
/
CustomerId.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
using System;
namespace Shared
{
public class CustomerId : IEquatable<CustomerId>
{
public readonly string Id;
public CustomerId(string id)
{
Id = id;
}
public bool Equals(CustomerId other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return string.Equals(Id, other.Id);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((CustomerId)obj);
}
public override int GetHashCode()
{
return (Id != null ? Id.GetHashCode() : 0);
}
}
}