예제 #1
0
        private static Task <ValidateResult> ValidateContactInformation(InformationRForm state, object response)
        {
            var    result      = new ValidateResult();
            string contactInfo = string.Empty;

            if (GetTwitterHandle((string)response, out contactInfo) || GetEmailAddress((string)response, out contactInfo))
            {
                result.IsValid = true;
                result.Value   = contactInfo;
            }
            else
            {
                result.IsValid  = false;
                result.Feedback = "Has ingresado un email no válido, vuelve a intentarlo por favor.";
            }
            return(Task.FromResult(result));
        }
예제 #2
0
 private static bool RequestEnabled(InformationRForm state) =>
 !string.IsNullOrWhiteSpace(state.Contact) && !string.IsNullOrWhiteSpace(state.Name);