IConventionTypeBase.AddProperty Method

Definition

Overloads

AddProperty(String, Type, Boolean, Boolean)

Adds a property to this entity type.

AddProperty(String, Type, MemberInfo, Boolean, Boolean)

Adds a property to this entity type.

AddProperty(MemberInfo, Boolean)

Adds a property to this entity type.

AddProperty(String, Boolean)

Adds a property to this entity type.

AddProperty(String, Type, Boolean, Boolean)

Adds a property to this entity type.

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

Parameters

name
String

The name of the property to add.

propertyType
Type

The type of value the property will hold.

setTypeConfigurationSource
Boolean

Indicates whether the type configuration source should be set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created property.

Applies to

AddProperty(String, Type, MemberInfo, Boolean, Boolean)

Adds a property to this entity type.

public Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? AddProperty (string name, Type propertyType, System.Reflection.MemberInfo memberInfo, bool setTypeConfigurationSource = true, bool fromDataAnnotation = false);
abstract member AddProperty : string * Type * System.Reflection.MemberInfo * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
Public Function AddProperty (name As String, propertyType As Type, memberInfo As MemberInfo, Optional setTypeConfigurationSource As Boolean = true, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

Parameters

name
String

The name of the property to add.

propertyType
Type

The type of value the property will hold.

memberInfo
MemberInfo

The corresponding CLR type member.

An indexer with a String parameter and Object return type can be used.

setTypeConfigurationSource
Boolean

Indicates whether the type configuration source should be set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created property.

Applies to

AddProperty(MemberInfo, Boolean)

Adds a property to this entity type.

[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Currently used only in tests")]
public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? AddProperty (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Currently used only in tests")>]
abstract member AddProperty : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
override this.AddProperty : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
Public Overridable Function AddProperty (memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

Parameters

memberInfo
MemberInfo

The corresponding member on the entity class.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created property.

Attributes

Applies to

AddProperty(String, Boolean)

Adds a property to this entity type.

public Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? AddProperty (string name, bool fromDataAnnotation = false);
abstract member AddProperty : string * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
Public Function AddProperty (name As String, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

Parameters

name
String

The name of the property to add.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created property.

Applies to