public void UpdateColor(TagColor color) { if (color == null) { throw new ArgumentNullException(nameof(color)); } Color = color; // Event }
public Tag(Guid id, string name, string description, TagColor color) : base(id) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("Value should not be empty!", nameof(name)); } if (string.IsNullOrWhiteSpace(description)) { throw new ArgumentException("Value should not be empty!", nameof(description)); } if (color == null) { throw new ArgumentNullException(nameof(color)); } Name = name; Description = description; Color = color; }