| | | 1 | | using Microsoft.Extensions.DependencyInjection; |
| | | 2 | | |
| | | 3 | | namespace AsiBackbone.DependencyInjection; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Provides the explicit <c>AddAsiBackbone</c> dependency injection entry point. |
| | | 7 | | /// </summary> |
| | | 8 | | public static class AsiBackboneServiceCollectionExtensions |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Adds an explicit AsiBackbone builder facade for host-selected provider registrations. |
| | | 12 | | /// </summary> |
| | | 13 | | /// <param name="services">The service collection to configure.</param> |
| | | 14 | | /// <param name="configure">The callback that names the provider registrations the host wants.</param> |
| | | 15 | | /// <returns>The same service collection so calls can be chained.</returns> |
| | | 16 | | /// <exception cref="ArgumentNullException"> |
| | | 17 | | /// Thrown when <paramref name="services" /> or <paramref name="configure" /> is <see langword="null" />. |
| | | 18 | | /// </exception> |
| | | 19 | | /// <remarks> |
| | | 20 | | /// This method does not register Core, persistence, endpoint governance, telemetry, signing, outbox, or local-devel |
| | | 21 | | /// Provider packages contribute their own <c>Use*</c> extension methods, and only those explicitly called by the ho |
| | | 22 | | /// </remarks> |
| | | 23 | | public static IServiceCollection AddAsiBackbone( |
| | | 24 | | this IServiceCollection services, |
| | | 25 | | Action<IAsiBackboneBuilder> configure) |
| | | 26 | | { |
| | 8 | 27 | | ArgumentNullException.ThrowIfNull(services); |
| | 8 | 28 | | ArgumentNullException.ThrowIfNull(configure); |
| | | 29 | | |
| | 8 | 30 | | var builder = new AsiBackboneBuilder(services); |
| | 8 | 31 | | configure(builder); |
| | | 32 | | |
| | 8 | 33 | | return services; |
| | | 34 | | } |
| | | 35 | | } |