Table of Contents

Interface IConventionServiceProperty

Namespace
Microsoft.EntityFrameworkCore.Metadata
Assembly
Microsoft.EntityFrameworkCore.dll

A IReadOnlyPropertyBase in the Entity Framework model that represents an injected service from the DbContext.

public interface IConventionServiceProperty : IReadOnlyServiceProperty, IConventionPropertyBase, IReadOnlyPropertyBase, IConventionAnnotatable, IReadOnlyAnnotatable
Inherited Members
Extension Methods

Remarks

This interface is used during model creation and allows the metadata to be modified. Once the model is built, IServiceProperty represents a read-only view of the same metadata.

See Model building conventions for more information and examples.

Properties

Builder

Gets the builder that can be used to configure this service property.

IConventionServicePropertyBuilder Builder { get; }

Property Value

IConventionServicePropertyBuilder

Exceptions

InvalidOperationException

If the service property has been removed from the model.

DeclaringEntityType

Gets the type that this property belongs to.

IConventionEntityType DeclaringEntityType { get; }

Property Value

IConventionEntityType

Methods

GetParameterBindingConfigurationSource()

Returns the configuration source for ParameterBinding.

ConfigurationSource? GetParameterBindingConfigurationSource()

Returns

ConfigurationSource?

The configuration source for ParameterBinding.

SetParameterBinding(ServiceParameterBinding?, bool)

Sets the ServiceParameterBinding for this property.

ServiceParameterBinding? SetParameterBinding(ServiceParameterBinding? parameterBinding, bool fromDataAnnotation = false)

Parameters

parameterBinding ServiceParameterBinding

The parameter binding.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

ServiceParameterBinding

The configured binding.