Goedel.Mesh.MeshClient.Validate C# (CSharp) Method

Validate() public method

Check to see if an account name is acceptable for use at a portal. Note that a positive response to a validation request does not guarantee that the account name will be available for a subsequent call to CreatePersonalProfile.
public Validate ( string Account ) : ValidateResponse
Account string The requested account name.
return ValidateResponse
        public ValidateResponse Validate(string Account) {
            var ValidateRequest = new ValidateRequest();

            ValidateRequest.Account = Account;
            ValidateRequest.Language = new List<string> { "en-uk" };

            var ValidateResponse = MeshService.ValidateAccount(ValidateRequest);

            return ValidateResponse;
            }

Usage Example

        /// <summary>
        /// Attempt to create an account at the specified portal.
        /// </summary>
        /// <param name="Portal"></param>
        /// <param name="Account"></param>
        /// <returns>true if succeeded, false otherwise.</returns>
        public bool TryNewPortalAccount(string Portal, string Account) {
            Portal = (Portal == null) || (Portal == "") ? "mesh.prismproof.org" : Portal;


            this.Portal = Portal;
            this.AccountName = Account;

            MeshClient = new MeshClient(Portal);


            var ValidateResponse = MeshClient.Validate(AccountID);

            if (!ValidateResponse.Valid) {
                InvalidInput = ValidateResponse.Reason;
                }

            return ValidateResponse.Valid;
            }
All Usage Examples Of Goedel.Mesh.MeshClient::Validate