Add avatar support
This commit is contained in:
@@ -35,6 +35,8 @@ public class Profile
|
||||
|
||||
public DateTimeOffset CreatedAt { get; private set; }
|
||||
|
||||
public Avatar Avatar { get; private set; } = Avatar.Empty;
|
||||
|
||||
public static Profile Create(
|
||||
string name,
|
||||
PlatformType platform,
|
||||
@@ -81,6 +83,9 @@ public class Profile
|
||||
public void RevokeModerator()
|
||||
=> IsModerator = false;
|
||||
|
||||
public void SetAvatar(Avatar avatar)
|
||||
=> Avatar = avatar ?? throw new DomainException("Avatar is required.");
|
||||
|
||||
private static string RequireValue(string value, string parameterName)
|
||||
=> !string.IsNullOrWhiteSpace(value) ? value : throw new DomainException($"{parameterName} is required.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user