コード例 #1
0
        public async Task <String> ValidateAsync(String input)
        {
            String validationMessage = null;

            if (!String.IsNullOrWhiteSpace(input))
            {
                var query             = new ArtifactQueries();
                var clientQueryResult = await query.GetClientAsync(_apiOptions, _clientRepository, input);

                if (clientQueryResult.Success && clientQueryResult.Results.Count > 0)
                {
                    _callback(new Client(clientQueryResult.Results[0].Artifact.ArtifactID));
                }
                else
                {
                    validationMessage = String.Format(Constant.Messages.Violations.ClientDoesntExist, input);
                }
            }
            return(validationMessage);
        }