Class BowireCatalogueServiceCollectionExtensions
- Namespace
- Kuestenlogik.Bowire.Sources
- Assembly
- Kuestenlogik.Bowire.dll
DI helpers for wiring an IBowireCatalogueProvider
into the host (#136). Pair with AddBowire():
public static class BowireCatalogueServiceCollectionExtensions
- Inheritance
-
BowireCatalogueServiceCollectionExtensions
- Inherited Members
Examples
builder.Services
.AddBowire()
.AddBowireCatalogue(builder.Configuration);
Methods
AddBowireCatalogue(IServiceCollection, IConfiguration)
Wire the catalogue-provider seam. Binds
Bowire:Discovery:Catalogue,
Bowire:Discovery:Catalogue:Local,
Bowire:Discovery:Catalogue:Http, and
Bowire:Discovery:Catalogue:Consul via the standard
options pattern, and registers the configured provider via
the BowireCatalogueProviderAccessor singleton.
public static IServiceCollection AddBowireCatalogue(this IServiceCollection services, IConfiguration configuration)
Parameters
servicesIServiceCollectionconfigurationIConfiguration
Returns
Remarks
Calling this is a no-op when
Bowire:Discovery:Catalogue:Provider is unset — the
accessor resolves to a null provider and the catalogue
endpoint short-circuits to an empty list. Setting it to an
unknown id throws at first accessor resolution so a typo in
appsettings.json surfaces immediately.
The endpoint GET /api/catalogue/entries is mapped
unconditionally by MapBowire() — it just returns an
empty list when no provider is registered.
AddBowireCatalogue(IServiceCollection, Action<BowireCatalogueOptions>)
Overload that takes an explicit configure callback for hosts
that don't bind IConfiguration. Mirrors the
AddBowire(Action<BowireOptions>) shape.
public static IServiceCollection AddBowireCatalogue(this IServiceCollection services, Action<BowireCatalogueOptions> configure)
Parameters
servicesIServiceCollectionconfigureAction<BowireCatalogueOptions>