|
|
@ -75,9 +75,9 @@ public class Author : FullAuditedAggregateRoot<Guid> |
|
|
|
|
|
|
|
|
internal Author( |
|
|
internal Author( |
|
|
Guid id, |
|
|
Guid id, |
|
|
[NotNull] string name, |
|
|
string name, |
|
|
DateTime birthDate, |
|
|
DateTime birthDate, |
|
|
[CanBeNull] string shortBio = null) |
|
|
string? shortBio = null) |
|
|
: base(id) |
|
|
: base(id) |
|
|
{ |
|
|
{ |
|
|
SetName(name); |
|
|
SetName(name); |
|
|
@ -85,13 +85,13 @@ public class Author : FullAuditedAggregateRoot<Guid> |
|
|
ShortBio = shortBio; |
|
|
ShortBio = shortBio; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
internal Author ChangeName([NotNull] string name) |
|
|
internal Author ChangeName(string name) |
|
|
{ |
|
|
{ |
|
|
SetName(name); |
|
|
SetName(name); |
|
|
return this; |
|
|
return this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void SetName([NotNull] string name) |
|
|
private void SetName(string name) |
|
|
{ |
|
|
{ |
|
|
Name = Check.NotNullOrWhiteSpace( |
|
|
Name = Check.NotNullOrWhiteSpace( |
|
|
name, |
|
|
name, |
|
|
@ -146,9 +146,9 @@ public class AuthorManager : DomainService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<Author> CreateAsync( |
|
|
public async Task<Author> CreateAsync( |
|
|
[NotNull] string name, |
|
|
string name, |
|
|
DateTime birthDate, |
|
|
DateTime birthDate, |
|
|
[CanBeNull] string shortBio = null) |
|
|
string? shortBio = null) |
|
|
{ |
|
|
{ |
|
|
Check.NotNullOrWhiteSpace(name, nameof(name)); |
|
|
Check.NotNullOrWhiteSpace(name, nameof(name)); |
|
|
|
|
|
|
|
|
@ -167,8 +167,8 @@ public class AuthorManager : DomainService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task ChangeNameAsync( |
|
|
public async Task ChangeNameAsync( |
|
|
[NotNull] Author author, |
|
|
Author author, |
|
|
[NotNull] string newName) |
|
|
string newName) |
|
|
{ |
|
|
{ |
|
|
Check.NotNull(author, nameof(author)); |
|
|
Check.NotNull(author, nameof(author)); |
|
|
Check.NotNullOrWhiteSpace(newName, nameof(newName)); |
|
|
Check.NotNullOrWhiteSpace(newName, nameof(newName)); |
|
|
|