KpokPatagonBuilder

Kpok patagon framework helper class for DI configuration.

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

Constructors

KpokPatagonBuilder

Initializes a new instance of KpokPatagonBuilder.

Signature:
public Void KpokPatagonBuilder(services, configuration)
Parameters
Name Type Summary
services IServiceCollection The collection of service descriptors
configuration IConfiguration Application configuration.
Exceptions
Type Summary
ArgumentNullException

Thown when services is null.

-or-

When configuration is null.

Properties

Assemblies

A collection of framework assemblies.

Signature:
public Assembly[] Assemblies { get; }

Configuration

Application configuration.

Signature:
public IConfiguration Configuration { get; }

Services

The collection of service descriptors.

Signature:
public IServiceCollection Services { get; }

Methods

CreateServiceInstance

Creates an instance of from a class named typeName.

Signature:
public T CreateServiceInstance<T>(provider, typeName)
Returns

An instace of or null if a class with the specified typeName could not be found.

Parameters
Name Type Summary
provider IServiceProvider The service provider used to resolve dependencies.
typeName String The Fullname of Name of the object to create.
Exceptions
Type Summary
ArgumentNullException

Thrown when provider is null.

ArgumentException

Thrown when typeName is null or empty.

GetTypesAssignableFrom

Gets an array of Types that are assinable to desiredType.

Signature:
public Type[] GetTypesAssignableFrom(desiredType)
Parameters
Name Type Summary
desiredType Type

GetTypesAssignableFrom

Gets an array of Types that are assinable to .

Signature:
public Type[] GetTypesAssignableFrom<T>()