DbConfiguration.SetSpatialServices Method
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.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | 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. |
DbConfiguration.SetSpatialServices Method (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( DbProviderInfo key, DbSpatialServices spatialProvider )
Parameters
- key
-
Type:
System.Data.Entity.Infrastructure.DbProviderInfo
The DbProviderInfo indicating the type of ADO.NET connection for which this spatial provider will be used.
- spatialProvider
-
Type:
System.Data.Entity.Spatial.DbSpatialServices
The spatial provider.
Use SetSpatialServices to register spatial services for use only when a specific manifest token is returned by the provider. Use SetDefaultSpatialServices 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.
DbConfiguration.SetSpatialServices Method (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, DbSpatialServices spatialProvider )
Parameters
- providerInvariantName
-
Type:
System.String
The ADO.NET provider invariant name indicating the type of ADO.NET connection for which this spatial provider will be used.
- spatialProvider
-
Type:
System.Data.Entity.Spatial.DbSpatialServices
The spatial provider.
Use SetSpatialServices to register spatial services for use when any manifest token is returned by the provider. Use SetDefaultSpatialServices 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.