using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Svrnty.GeoManagement.Abstractions.Abstractions;
using Svrnty.GeoManagement.Google.Configuration;
namespace Svrnty.GeoManagement.Google.Extensions;
///
/// Extension methods for registering Google Geocoding services
///
public static class ServiceCollectionExtensions
{
///
/// Adds Google Geocoding provider to the service collection
///
/// The service collection
/// Configuration section containing GoogleGeoManagementOptions
/// The service collection for chaining
public static IServiceCollection AddGoogleGeoManagement(
this IServiceCollection services,
IConfiguration configuration)
{
services.Configure(configuration);
services.AddScoped();
return services;
}
///
/// Adds Google Geocoding provider to the service collection with manual configuration
///
/// The service collection
/// Action to configure GoogleGeoManagementOptions
/// The service collection for chaining
public static IServiceCollection AddGoogleGeoManagement(
this IServiceCollection services,
Action configureOptions)
{
services.Configure(configureOptions);
services.AddScoped();
return services;
}
}