TaxonomyServiceExtensions
Pennington.Taxonomy
DI + endpoint helpers for registering and mounting taxonomy axes (browse-by-tag, browse-by-cuisine, browse-by-audience, ...).
Methods
AddTaxonomy<TFrontMatter, TKey>
#public static IServiceCollection AddTaxonomy<TFrontMatter, TKey>(IServiceCollection services, Action<TaxonomyOptions<TFrontMatter, TKey>> configure)
Registers a TaxonomyContentService configured by configure. Multiple AddTaxonomy calls with the same TFrontMatter/TKey pair coexist as long as each uses a distinct BaseUrl.
Parameters
servicesIServiceCollectionconfigureAction<TaxonomyOptions<TFrontMatter, TKey>>
Returns
IServiceCollectionMapTaxonomy<TFrontMatter, TKey>
#public static IEndpointRouteBuilder MapTaxonomy<TFrontMatter, TKey>(IEndpointRouteBuilder routes)
Mounts the live HTTP endpoints for every TaxonomyContentService registered for the given type pair. The index URL renders IndexPage with a Terms parameter; per-term URLs render TermPage with a Term parameter.
Parameters
routesIEndpointRouteBuilder
Returns
IEndpointRouteBuilderPennington.Taxonomy.TaxonomyServiceExtensions
namespace Pennington.Taxonomy;
/// DI + endpoint helpers for registering and mounting taxonomy axes (browse-by-tag, browse-by-cuisine, browse-by-audience, ...).
public class TaxonomyServiceExtensions
{
/// Registers a TaxonomyContentService configured by configure. Multiple AddTaxonomy calls with the same TFrontMatter/TKey pair coexist as long as each uses a distinct BaseUrl.
public static IServiceCollection AddTaxonomy<TFrontMatter, TKey>(IServiceCollection services, Action<TaxonomyOptions<TFrontMatter, TKey>> configure)
;
/// Mounts the live HTTP endpoints for every TaxonomyContentService registered for the given type pair. The index URL renders IndexPage with a Terms parameter; per-term URLs render TermPage with a Term parameter.
public static IEndpointRouteBuilder MapTaxonomy<TFrontMatter, TKey>(IEndpointRouteBuilder routes)
;
}