| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="ServiceCollectionExtensions.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using Microsoft.Extensions.DependencyInjection; |
| | | 8 | | using Microsoft.Extensions.DependencyInjection.Extensions; |
| | | 9 | | |
| | | 10 | | #pragma warning disable IDE0130 // Namespace does not match folder structure |
| | | 11 | | namespace MyNet.Geography.Resources; |
| | | 12 | | #pragma warning restore IDE0130 // Namespace does not match folder structure |
| | | 13 | | |
| | | 14 | | public static class ServiceCollectionExtensions |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Adds the embedded country flag provider to the service collection, allowing retrieval of country flags from embe |
| | | 18 | | /// </summary> |
| | | 19 | | /// <param name="services">The service collection to which the provider will be added.</param> |
| | | 20 | | /// <returns>The updated service collection.</returns> |
| | | 21 | | public static IServiceCollection AddGeographyFlags(this IServiceCollection services) |
| | | 22 | | { |
| | 15 | 23 | | services.TryAddSingleton<ICountryFlagProvider, EmbeddedCountryFlagProvider>(); |
| | | 24 | | |
| | 15 | 25 | | return services; |
| | | 26 | | } |
| | | 27 | | } |
| | | 28 | | |