// ファクトリとして機能するメソッド public Circle CreateCircle(CircleName circleName) { return(new Circle( id, circleName )); }
public Circle(UserId ownerId, CircleName name) { if (ownerId == null) { throw new ArgumentNullException(nameof(ownerId)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } OwnerId = ownerId; Name = name; }