| | | 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 MyNet.Geography.Localization.Providers; |
| | | 9 | | using MyNet.Humanizer; |
| | | 10 | | |
| | | 11 | | #pragma warning disable IDE0130 // Namespace does not match folder structure |
| | | 12 | | namespace MyNet.Geography; |
| | | 13 | | #pragma warning restore IDE0130 // Namespace does not match folder structure |
| | | 14 | | |
| | | 15 | | public static class ServiceCollectionExtensions |
| | | 16 | | { |
| | | 17 | | /// <summary> |
| | | 18 | | /// Adds the embedded country flag provider to the service collection, allowing retrieval of country flags from embe |
| | | 19 | | /// </summary> |
| | | 20 | | /// <param name="services">The service collection to which the provider will be added.</param> |
| | | 21 | | /// <returns>The updated service collection.</returns> |
| | | 22 | | public static IServiceCollection AddGeographyLocalization(this IServiceCollection services) |
| | | 23 | | { |
| | 9 | 24 | | services.AddDisplayTextStrategy<Country, CountryDisplayTextStrategy>(); |
| | | 25 | | |
| | 9 | 26 | | return services; |
| | | 27 | | } |
| | | 28 | | } |
| | | 29 | | |