layout: default title: DependencyExtension parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core

DependencyExtension Class

Static extension class for injecting GeoBlazor types

public static class DependencyExtension

Inheritance System.Object 🡒 DependencyExtension

Methods

DependencyExtension.AddGeoBlazor(this IServiceCollection, IConfiguration) Method

Adds the Logic components GeometryEngine and Projection to your dependency
injection collection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddGeoBlazor(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Microsoft.Extensions.Configuration.IConfiguration? configuration=null);

Parameters

serviceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection

configuration Microsoft.Extensions.Configuration.IConfiguration

Returns

Microsoft.Extensions.DependencyInjection.IServiceCollection

Remarks

Since Scoped services behave like singletons in client applications (wasm, maui), registering the OAuthAuthentication
service as scoped is safe for all implementations.
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/dependency-injection?view=aspnetcore-7.0#service-lifetime