Skip to content

Commit f754902

Browse files
committed
Add a subscriber constructor.
1 parent a5e5715 commit f754902

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Core/Domain/Models/Subscriber.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,13 @@ public class Subscriber: ISubscriber
66
{
77
public Guid Id { get; set; }
88
public string EmailAddress { get; set; }
9+
10+
public Subscriber(string emailAddress)
11+
{
12+
if (string.IsNullOrEmpty(emailAddress)) throw new ArgumentException("message", nameof(emailAddress));
13+
14+
EmailAddress = emailAddress;
15+
Id = Guid.NewGuid();
16+
}
917
}
1018
}

0 commit comments

Comments
 (0)