語言

OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.PrimitiveCollection<TProperty> 方法

定義

回傳一個物件,可用於配置擁有型別的屬性,該屬性代表一組原始值,例如字串或整數。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> PrimitiveCollection<TProperty>(System.Linq.Expressions.Expression<Func<TDependentEntity,TProperty>> propertyExpression);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> PrimitiveCollection<TProperty>(System.Linq.Expressions.Expression<Func<TDependentEntity,TProperty>> propertyExpression);
override this.PrimitiveCollection : System.Linq.Expressions.Expression<Func<'DependentEntity, 'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property>
override this.PrimitiveCollection : System.Linq.Expressions.Expression<Func<'DependentEntity, 'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
Public Overridable Function PrimitiveCollection(Of TProperty) (propertyExpression As Expression(Of Func(Of TDependentEntity, TProperty))) As PrimitiveCollectionBuilder(Of TProperty)
Public Overridable Function PrimitiveCollection(Of TProperty) (propertyExpression As Expression(Of Func(Of TDependentEntity, TProperty))) As PropertyBuilder(Of TProperty)

類型參數

TProperty

要設定的財產類型。

參數

propertyExpression
Expression<Func<TDependentEntity,TProperty>>

一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。

傳回

一個可以用來設定屬性的物件。

備註

新增屬性時,如果實體類別中有同名屬性,該物件會被加入模型中。 若實體類別中不存在屬性,則會新增一個影子狀態屬性。 影子狀態屬性是指在實體類別中沒有對應屬性的屬性。 屬性的當前值會儲存在實體 ChangeTracker 類別的實例中,而非儲存在實體類別的實例中。

適用於