KpokPatagonDataServiceProviderExtensions

Provides helper extension methods for the IServiceProvider

Namespace:
KpokPatagon.Data.DependencyInjection
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
Yes

Methods

GetDataServiceForDataModel

Gets from the dependency injection container the IDataService for the specifed dataModelType.

Signature:
public IDataService GetDataServiceForDataModel(provider, dataModelType)
Returns

The IDataService for the dataModelType or null if it cannot be found.

Parameters
Name Type Summary
provider IServiceProvider The IServiceProvider.
dataModelType Type The Type of an IDataModel.
Exceptions
Type Summary
ArgumentNullException

Thrown when provider is null.

-or-

When dataModelType is null.

InvalidOperationException

Thrown when dataModelType is not an IDataModel.

-or-

When a configured type is not registered within the dependency injection container.

GetDbAccessRequiredService

Gets from the dependency injection container an IDbAccess service with the specified name.

Signature:
public IDbAccess GetDbAccessRequiredService(provider, name)
Returns

An IDbAccess service for the specified name.

Parameters
Name Type Summary
provider IServiceProvider The IServiceProvider.
name String The name of the service to get.
Exceptions
Type Summary
ArgumentNullException Thrown when provider is null.
ArgumentException Thrown when name is null or empty.
InvalidOperationException Thrown when there is no IDbAccess service with the specified name.

GetDbCmdBuilderRequiredService

Gets from the dependency injection container an IDbCmdBuilder service with the specified name.

Signature:
public IDbCmdBuilder GetDbCmdBuilderRequiredService(provider, name)
Returns

An IDbCmdBuilder service for the specified name.

Parameters
Name Type Summary
provider IServiceProvider The IServiceProvider.
name String The name of the service to get.
Exceptions
Type Summary
ArgumentNullException Thrown when provider is null.
ArgumentException Thrown when name is null or empty.
InvalidOperationException Thrown when there is no IDbCmdBuilder service with the specified name.

GetSchemaDiscovererRequiredService

Gets from the dependency injection container an ISchemaDiscoverer service with the specified name.

Signature:
public ISchemaDiscoverer GetSchemaDiscovererRequiredService(provider, name)
Returns

An ISchemaDiscoverer service for the specified name.

Parameters
Name Type Summary
provider IServiceProvider The IServiceProvider.
name String The name of the service to get.
Exceptions
Type Summary
ArgumentNullException Thrown when provider is null.
ArgumentException Thrown when name is null or empty.
InvalidOperationException Thrown when there is no ISchemaDiscoverer service with the specified name.

GetSchemaProvisionerRequiredService

Gets from the dependency injection container an ISchemaProvisioner service with the specified name.

Signature:
public ISchemaProvisioner GetSchemaProvisionerRequiredService(provider, name)
Returns

An ISchemaProvisioner service for the specified name.

Parameters
Name Type Summary
provider IServiceProvider The IServiceProvider.
name String The name of the service to get.
Exceptions
Type Summary
ArgumentNullException Thrown when provider is null.
ArgumentException Thrown when name is null or empty.
InvalidOperationException Thrown when there is no ISchemaProvisioner service with the specified name.

GetViewBuilderRequiredService

Gets from the dependency injection container an IViewBuilder service with the specified name.

Signature:
public IViewBuilder GetViewBuilderRequiredService(provider, name)
Returns

An IViewBuilder service for the specified name.

Parameters
Name Type Summary
provider IServiceProvider The IServiceProvider.
name String The name of the service to get.
Exceptions
Type Summary
ArgumentNullException Thrown when provider is null.
ArgumentException Thrown when name is null or empty.
InvalidOperationException Thrown when there is no IViewBuilder service with the specified name.