DbConfiguration.SetSpatialServices Method

Definition

Overloads

SetSpatialServices(DbProviderInfo, DbSpatialServices)

Call this method from the constructor of a class derived from DbConfiguration to set an implementation of DbSpatialServices to use for a specific provider and provider manifest token.

SetSpatialServices(String, DbSpatialServices)

Call this method from the constructor of a class derived from DbConfiguration to set an implementation of DbSpatialServices to use for a specific provider with any manifest token.

SetSpatialServices(DbProviderInfo, DbSpatialServices)

Call this method from the constructor of a class derived from DbConfiguration to set an implementation of DbSpatialServices to use for a specific provider and provider manifest token.

protected internal void SetSpatialServices (System.Data.Entity.Infrastructure.DbProviderInfo key, System.Data.Entity.Spatial.DbSpatialServices spatialProvider);
member this.SetSpatialServices : System.Data.Entity.Infrastructure.DbProviderInfo * System.Data.Entity.Spatial.DbSpatialServices -> unit
Protected Friend Sub SetSpatialServices (key As DbProviderInfo, spatialProvider As DbSpatialServices)

Parameters

key
DbProviderInfo

The DbProviderInfo indicating the type of ADO.NET connection for which this spatial provider will be used.

spatialProvider
DbSpatialServices

The spatial provider.

Remarks

Use SetSpatialServices(DbProviderInfo, DbSpatialServices) to register spatial services for use only when a specific manifest token is returned by the provider. Use SetDefaultSpatialServices(DbSpatialServices) to register global spatial services to be used when provider information is not available or no provider-specific spatial services are found. This method is provided as a convenient and discoverable way to add configuration to the Entity Framework. Internally it works in the same way as using AddDependencyResolver to add an appropriate resolver for DbSpatialServices. This means that, if desired, the same functionality can be achieved using a custom resolver or a resolver backed by an Inversion-of-Control container.

Applies to

SetSpatialServices(String, DbSpatialServices)

Call this method from the constructor of a class derived from DbConfiguration to set an implementation of DbSpatialServices to use for a specific provider with any manifest token.

protected internal void SetSpatialServices (string providerInvariantName, System.Data.Entity.Spatial.DbSpatialServices spatialProvider);
member this.SetSpatialServices : string * System.Data.Entity.Spatial.DbSpatialServices -> unit
Protected Friend Sub SetSpatialServices (providerInvariantName As String, spatialProvider As DbSpatialServices)

Parameters

providerInvariantName
String

The ADO.NET provider invariant name indicating the type of ADO.NET connection for which this spatial provider will be used.

spatialProvider
DbSpatialServices

The spatial provider.

Remarks

Use SetSpatialServices(String, DbSpatialServices) to register spatial services for use when any manifest token is returned by the provider. Use SetDefaultSpatialServices(DbSpatialServices) to register global spatial services to be used when provider information is not available or no provider-specific spatial services are found.

This method is provided as a convenient and discoverable way to add configuration to the Entity Framework. Internally it works in the same way as using AddDependencyResolver to add an appropriate resolver for DbSpatialServices. This means that, if desired, the same functionality can be achieved using a custom resolver or a resolver backed by an Inversion-of-Control container.

Applies to