private static Task <ValidateResult> ValidateContactInformation(SuggestionForm 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)); }
private static bool SuggestionEnabled(SuggestionForm state) => !string.IsNullOrWhiteSpace(state.Contact) && !string.IsNullOrWhiteSpace(state.Name);