Example #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));
        }
Example #2
0
 private static bool RequestEnabled(InformationRForm state) =>
 !string.IsNullOrWhiteSpace(state.Contact) && !string.IsNullOrWhiteSpace(state.Name);