Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public static bool HasAutoComplete(this ModelExplorer property, out AutoCompleteAttribute autoComplete)
 {
     return(property.HasAttribute <AutoCompleteAttribute>(out autoComplete));
 }