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
dependenciesProviderConventionSetBuilderDependenciesThe core dependencies for this service.
converterFactoryIComplexTypeConverterFactoryThe 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
converterFactoryIComplexTypeConverterFactoryThe IComplexTypeConverterFactory populated by KEFCoreComplexTypeConverterConvention during model finalization.
Returns
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
converterFactoryIComplexTypeConverterFactoryThe IComplexTypeConverterFactory populated by KEFCoreComplexTypeConverterConvention during model finalization.