Affecto.IdentityManagement.WebApi.IdentityManagementController.AddUserAccount C# (CSharp) Method

AddUserAccount() private method

private AddUserAccount ( System.Guid userId, AddUserAccountCommand command ) : IHttpActionResult
userId System.Guid
command Affecto.IdentityManagement.WebApi.Model.AddUserAccountCommand
return IHttpActionResult
        public IHttpActionResult AddUserAccount(Guid userId, AddUserAccountCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }
            if (string.IsNullOrWhiteSpace(command.Name))
            {
                throw new ArgumentException("Account name must be defined.");
            }
            if (userId == Guid.Empty)
            {
                throw new ArgumentException("userId must be defined.");
            }

            AccountType type = ParseAccountType(command.Type);

            if (type == AccountType.Password)
            {
                identityManagementService.AddUserAccount(userId, command.Name, command.Password);
            }
            else
            {
                identityManagementService.AddExternalUserAccount(userId, type, command.Name);
            }

            return Ok();
        }