Exemplo n.º 1
0
        public void ChangeType(BoardUserType newType)
        {
            if (!Enum.IsDefined(typeof(BoardUserType), newType))
            {
                throw new InvalidOperationException(nameof(newType));
            }

            Type = newType;
        }
Exemplo n.º 2
0
        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;
        }