public void ChangeType(BoardUserType newType) { if (!Enum.IsDefined(typeof(BoardUserType), newType)) { throw new InvalidOperationException(nameof(newType)); } Type = newType; }
internal BoardUser(int boardId, string userId, BoardUserType type) { if (boardId <= 0) { throw new ArgumentOutOfRangeException(nameof(boardId)); } if (string.IsNullOrEmpty(userId)) { throw new ArgumentException(nameof(userId)); } if (!Enum.IsDefined(typeof(BoardUserType), type)) { throw new InvalidOperationException(nameof(type)); } BoardId = boardId; UserId = userId; Type = type; }