Table of Contents

Class ParameterBinding

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

Describes the binding from one or many EF model properties, dependency injection services, or metadata types to a parameter in a constructor, factory method, or similar.

public abstract class ParameterBinding
Inheritance
ParameterBinding
Derived
Inherited Members

Remarks

See Entity types with constructors for more information and examples.

Constructors

ParameterBinding(Type, params IPropertyBase[]?)

Creates a new ParameterBinding instance.

protected ParameterBinding(Type parameterType, params IPropertyBase[]? consumedProperties)

Parameters

parameterType Type

The parameter CLR type.

consumedProperties IPropertyBase[]

The properties that are handled by this binding and so do not need to be set in some other way.

Properties

ConsumedProperties

The properties that are handled by this binding and so do not need to be set in some other way.

public virtual IReadOnlyList<IPropertyBase> ConsumedProperties { get; }

Property Value

IReadOnlyList<IPropertyBase>

ParameterType

The parameter CLR type.

public virtual Type ParameterType { get; }

Property Value

Type

Methods

BindToParameter(ParameterBindingInfo)

Creates an expression tree representing the binding of the value of a property from a materialization expression to a parameter of the constructor, factory method, etc.

public abstract Expression BindToParameter(ParameterBindingInfo bindingInfo)

Parameters

bindingInfo ParameterBindingInfo

The binding information.

Returns

Expression

The expression tree.

With(IPropertyBase[])

Creates a copy that contains the given consumed properties.

public abstract ParameterBinding With(IPropertyBase[] consumedProperties)

Parameters

consumedProperties IPropertyBase[]

The new consumed properties.

Returns

ParameterBinding

A copy with replaced consumed properties.