예제 #1
0
        /// <summary>
        /// Deletes the user.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="userName">Name of the user.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentException">
        /// Id value is invalid
        /// or
        /// UserName value is invalid
        /// </exception>
        public Url DeleteUser(string id, string userName)
        {
            if (!id.IsShortCode())
            {
                throw new ArgumentException("Id value is invalid");
            }

            if (String.IsNullOrEmpty(userName))
            {
                throw new ArgumentException("UserName value is invalid");
            }

            try
            {
                List <string> users = new List <string>();
                users.Add(userName);
                return(_repository.DeleteUser(id, users));
            }
            catch (Exception ex)
            {
                throw HandleException(new object[] { id, userName }, ex);
            }
        }