Table of Contents

Class EntityFrameworkDesignServicesBuilder

Namespace
Microsoft.EntityFrameworkCore.Design
Assembly
Microsoft.EntityFrameworkCore.dll

A builder API designed for database providers to use when implementing IDesignTimeServices.

public class EntityFrameworkDesignServicesBuilder : EntityFrameworkServicesBuilder
Inheritance
EntityFrameworkDesignServicesBuilder
Inherited Members

Remarks

Providers should create an instance of this class, use its methods to register services, and then call TryAddCoreServices() to fill out the remaining Entity Framework services.

Entity Framework ensures that services are registered with the appropriate scope. In some cases a provider may register a service with a different scope, but great care must be taken that all its dependencies can handle the new scope, and that it does not cause issue for services that depend on it.

See Implementation of database providers and extensions for more information and examples.

Constructors

EntityFrameworkDesignServicesBuilder(IServiceCollection)

Creates a new EntityFrameworkDesignServicesBuilder for registration of provider services.

public EntityFrameworkDesignServicesBuilder(IServiceCollection serviceCollection)

Parameters

serviceCollection IServiceCollection

The collection to which services will be registered.

Fields

Services

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

[EntityFrameworkInternal]
public static readonly IDictionary<Type, ServiceCharacteristics> Services

Field Value

IDictionary<Type, ServiceCharacteristics>

Remarks

This dictionary is exposed for testing and provider-validation only. It should not be used from application code.

Methods

TryAddCoreServices()

Registers default implementations of all services, including relational services, not already registered by the provider. Relational database providers must call this method as the last step of service registration--that is, after all provider services have been registered.

public override EntityFrameworkServicesBuilder TryAddCoreServices()

Returns

EntityFrameworkServicesBuilder

This builder, such that further calls can be chained.

TryGetServiceCharacteristics(Type)

Gets the ServiceCharacteristics for the given service type.

protected override ServiceCharacteristics? TryGetServiceCharacteristics(Type serviceType)

Parameters

serviceType Type

The type that defines the service API.

Returns

ServiceCharacteristics?

The ServiceCharacteristics for the type or null if it's not an EF service.