SearchBasedApiDocUrlResolver Class
- Namespace
- Kampute.DocToolkit.Routing
- Assembly
- Kampute.DocToolkit.dll
Definition
Resolves URLs to search engines or documentation repositories for code elements that lack structured documentation.
public class SearchBasedApiDocUrlResolver : RemoteApiDocUrlResolver, ILanguageSpecific- Inheritance
- object
- RemoteApiDocUrlResolver
- SearchBasedApiDocUrlResolver
- Implements
Remarks
Constructors
| SearchBasedApiDocUrlResolver(Uri, string) | Initializes a new instance of the SearchBasedApiDocUrlResolver class with the specified search query parameter name. |
Properties
| Language | Gets or sets the programming language used for formatting the search term. |
| ParamName | Gets the name of the search query parameter used in constructing URLs. |
Methods
| BuildSearchUrl(string) | Creates a search URL for the specified term. |
| ResolveMemberUrl(IMember) | Attempts to resolve the documentation URL for the specified member. |
| ResolveNamespaceUrl(string) | Attempts to resolve the documentation URL for the specified namespace. |
Extension Methods
| TryGetUrlByCodeReference(this IApiDocUrlProvider, string, out Uri) | Attempts to retrieves the documentation URL for the specified code reference. |

- Third-party libraries without published documentation
- Legacy or uncommon APIs with limited documentation
- Custom or internal APIs where documentation might exist but in fragmented locations
This resolver constructs URLs with search query parameters, where the parameter name is specified in the constructor (defaults to "q"). The search term is the fully-qualified name of the code element, which can be optionally formatted using a specified programming language.To control which APIs this resolver handles, add namespace patterns to the RemoteApiDocUrlResolver.NamespacePatterns collection, using exact matches (e.g., "Contoso.Services"), wildcard patterns (e.g., "Contoso.*"), or the universal match pattern "*".
This resolver deliberately does not attempt to resolve URLs for explicitly implemented interface members, constructed generic types, and types with modifiers. This is because such cases are better understood by breaking them down into their component parts. For example, an implementation likeICollection<DateTime>.Countis better resolved through separate links to:- The
- The
- The
This approach provides a more robust learning path for developers trying to understand these implementation relationships.ICollection<T>interface documentationDateTimetype documentationCountproperty documentation on the interface