IConventionEntityTypeBuilder.Property Method

Definition

Overloads

Property(MemberInfo, Boolean)

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

Property(Type, String, Boolean, Boolean)

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

Property(MemberInfo, Boolean)

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

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

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

Property(Type, String, Boolean, Boolean)

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

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder Property (Type propertyType, string propertyName, bool setTypeConfigurationSource = true, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? Property (Type propertyType, string propertyName, bool setTypeConfigurationSource = true, bool fromDataAnnotation = false);
abstract member Property : Type * string * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function Property (propertyType As Type, propertyName As String, Optional setTypeConfigurationSource As Boolean = true, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

Parameters

propertyType
Type

The type of value the property will hold.

propertyName
String

The name of the property to be configured.

setTypeConfigurationSource
Boolean

Indicates whether the type configuration source should be set.

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