private TagHelperAttribute getAutoCompleteDataAttribute(AutoCompleteAttribute autoComplete, ModelExplorer parentModel) { if (!string.IsNullOrEmpty(autoComplete.SuggestionsProperty)) { string suggestions = autoComplete.GetSuggestionsAsJson(parentModel); return(new TagHelperAttribute("data-source-local", suggestions)); } else if (!string.IsNullOrEmpty(autoComplete.SuggestionsEndpoint)) { return(new TagHelperAttribute("data-source-ajax", autoComplete.SuggestionsEndpoint)); } return(null); }
public static bool HasAutoComplete(this ModelExplorer property, out AutoCompleteAttribute autoComplete) { return(property.HasAttribute <AutoCompleteAttribute>(out autoComplete)); }