RuntimeEntityType.AddServiceProperty Method

Definition

Overloads

AddServiceProperty(String, PropertyInfo, FieldInfo, PropertyAccessMode)

Adds a service property to this entity type.

AddServiceProperty(String, PropertyInfo, FieldInfo, Type, PropertyAccessMode)

Adds a service property to this entity type.

AddServiceProperty(String, PropertyInfo, FieldInfo, PropertyAccessMode)

Adds a service property to this entity type.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty AddServiceProperty (string name, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField);
abstract member AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
override this.AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
Public Overridable Function AddServiceProperty (name As String, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField) As RuntimeServiceProperty

Parameters

name
String

The name of the property to add.

propertyInfo
PropertyInfo

The corresponding CLR property or null for a shadow property.

fieldInfo
FieldInfo

The corresponding CLR field or null for a shadow property.

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode used for this property.

Returns

The newly created service property.

Applies to

AddServiceProperty(String, PropertyInfo, FieldInfo, Type, PropertyAccessMode)

Adds a service property to this entity type.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty AddServiceProperty (string name, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Type? serviceType = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField);
abstract member AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Type * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
override this.AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Type * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
Public Overridable Function AddServiceProperty (name As String, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional serviceType As Type = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField) As RuntimeServiceProperty

Parameters

name
String

The name of the property to add.

propertyInfo
PropertyInfo

The corresponding CLR property or null for a shadow property.

fieldInfo
FieldInfo

The corresponding CLR field or null for a shadow property.

serviceType
Type

The type of the service, or null to use the type of the member.

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode used for this property.

Returns

The newly created service property.

Applies to