IConventionEntityTypeBuilder.ServiceProperty Method

Definition

Overloads

ServiceProperty(MemberInfo, Boolean)

Returns an object that can be used to configure the service property with the given member info. If no matching property exists, then a new property will be added.

ServiceProperty(Type, MemberInfo, Boolean)

Returns an object that can be used to configure the service property with the given member info. If no matching property exists, then a new property will be added.

ServiceProperty(MemberInfo, Boolean)

Returns an object that can be used to configure the service property with the given member info. If no matching property exists, then a new property will be added.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionServicePropertyBuilder ServiceProperty (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionServicePropertyBuilder? ServiceProperty (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
abstract member ServiceProperty : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionServicePropertyBuilder
Public Function ServiceProperty (memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionServicePropertyBuilder

Parameters

memberInfo
MemberInfo

The PropertyInfo or FieldInfo of the property.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An object that can be used to configure the property if it exists on the entity type, null otherwise.

Applies to

ServiceProperty(Type, MemberInfo, Boolean)

Returns an object that can be used to configure the service property with the given member info. If no matching property exists, then a new property will be added.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionServicePropertyBuilder? ServiceProperty (Type serviceType, System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
abstract member ServiceProperty : Type * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionServicePropertyBuilder
Public Function ServiceProperty (serviceType As Type, memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionServicePropertyBuilder

Parameters

serviceType
Type

The type of the service.

memberInfo
MemberInfo

The PropertyInfo or FieldInfo of the property.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An object that can be used to configure the property if it exists on the entity type, null otherwise.

Applies to