Table of Contents

Class KEFCoreConventionSetBuilder

Namespace
MASES.EntityFrameworkCore.KNet.Metadata.Conventions
Assembly
MASES.EntityFrameworkCore.KNet.dll

A builder for building conventions for the KEFCore provider.

public class KEFCoreConventionSetBuilder : ProviderConventionSetBuilder, IProviderConventionSetBuilder
Inheritance
KEFCoreConventionSetBuilder
Implements
Inherited Members

Remarks

The service lifetime is Scoped and multiple registrations are allowed. This means that each DbContext instance will use its own set of instances of this service. The implementations may depend on other services registered with any lifetime. The implementations do not need to be thread-safe.

See Model building conventions, and The EF Core KNet database provider for more information and examples.

Constructors

KEFCoreConventionSetBuilder(ProviderConventionSetBuilderDependencies, IComplexTypeConverterFactory)

A builder for building conventions for the KEFCore provider.

public KEFCoreConventionSetBuilder(ProviderConventionSetBuilderDependencies dependencies, IComplexTypeConverterFactory converterFactory)

Parameters

dependencies ProviderConventionSetBuilderDependencies

The core dependencies for this service.

converterFactory IComplexTypeConverterFactory

The IComplexTypeConverterFactory instance

Remarks

The service lifetime is Scoped and multiple registrations are allowed. This means that each DbContext instance will use its own set of instances of this service. The implementations may depend on other services registered with any lifetime. The implementations do not need to be thread-safe.

See Model building conventions, and The EF Core KNet database provider for more information and examples.

Methods

Build()

Call this method to build a ConventionSet for the KEFCore provider when using the ModelBuilder outside of OnModelCreating(ModelBuilder).

public static ConventionSet Build()

Returns

ConventionSet

The convention set.

Remarks

Note that it is unusual to use this method. Consider using DbContext in the normal way instead.

Build(out IComplexTypeConverterFactory)

Builds a ConventionSet for KEFCore outside of OnModelCreating(ModelBuilder), exposing the IComplexTypeConverterFactory populated during model finalization.

public static ConventionSet Build(out IComplexTypeConverterFactory converterFactory)

Parameters

converterFactory IComplexTypeConverterFactory

The IComplexTypeConverterFactory populated by KEFCoreComplexTypeConverterConvention during model finalization.

Returns

ConventionSet

CreateConventionSet()

Builds and returns the convention set for the current database provider.

public override ConventionSet CreateConventionSet()

Returns

ConventionSet

The convention set for the current database provider.

CreateModelBuilder()

Call this method to build a ModelBuilder for KEFCore outside of OnModelCreating(ModelBuilder).

public static ModelBuilder CreateModelBuilder()

Returns

ModelBuilder

The convention set.

Remarks

Note that it is unusual to use this method. Consider using DbContext in the normal way instead.

CreateModelBuilder(out IComplexTypeConverterFactory)

Builds a ModelBuilder for KEFCore outside of OnModelCreating(ModelBuilder), exposing the IComplexTypeConverterFactory populated during model finalization.

public static ModelBuilder CreateModelBuilder(out IComplexTypeConverterFactory converterFactory)

Parameters

converterFactory IComplexTypeConverterFactory

The IComplexTypeConverterFactory populated by KEFCoreComplexTypeConverterConvention during model finalization.

Returns

ModelBuilder