EntityEntry<TEntity>.Reference 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Reference<TProperty>(INavigationBase) |
提供變更追蹤與載入資訊,用於參考(即非收藏)導覽,將此實體關聯到另一個實體。 |
| Reference<TProperty>(Expression<Func<TEntity,TProperty>>) |
提供變更追蹤與載入資訊,用於將此實體關聯到另一個實體的參考(即非集合)導航屬性。 |
| Reference<TProperty>(String) |
提供變更追蹤與載入資訊,用於參考(即非收藏)導覽,將此實體關聯到另一個實體。 |
Reference<TProperty>(INavigationBase)
提供變更追蹤與載入資訊,用於參考(即非收藏)導覽,將此實體關聯到另一個實體。
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<TEntity,TProperty> Reference<TProperty>(Microsoft.EntityFrameworkCore.Metadata.INavigationBase navigation) where TProperty : class;
override this.Reference : Microsoft.EntityFrameworkCore.Metadata.INavigationBase -> Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Reference(Of TProperty As Class) (navigation As INavigationBase) As ReferenceEntry(Of TEntity, TProperty)
類型參數
- TProperty
參數
- navigation
- INavigationBase
參考導航。
傳回
一個揭露該導航屬性變更追蹤資訊與操作的物件。
備註
更多資訊與範例請參閱 EF Core 中的「存取追蹤實體 」及 「變更外鍵與導覽 」。
適用於
Reference<TProperty>(Expression<Func<TEntity,TProperty>>)
提供變更追蹤與載入資訊,用於將此實體關聯到另一個實體的參考(即非集合)導航屬性。
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<TEntity,TProperty> Reference<TProperty>(System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression) where TProperty : class;
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<TEntity,TProperty> Reference<TProperty>(System.Linq.Expressions.Expression<Func<TEntity,TProperty?>> propertyExpression) where TProperty : class;
override this.Reference : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> -> Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Reference(Of TProperty As Class) (propertyExpression As Expression(Of Func(Of TEntity, TProperty))) As ReferenceEntry(Of TEntity, TProperty)
類型參數
- TProperty
參數
- propertyExpression
- Expression<Func<TEntity,TProperty>>
一個 lambda 運算式,代表用於存取資訊與操作的參考導航。
傳回
一個揭露該導航屬性變更追蹤資訊與操作的物件。
備註
更多資訊與範例請參閱 EF Core 中的「存取追蹤實體 」及 「變更外鍵與導覽 」。
適用於
Reference<TProperty>(String)
提供變更追蹤與載入資訊,用於參考(即非收藏)導覽,將此實體關聯到另一個實體。
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<TEntity,TProperty> Reference<TProperty>(string propertyName) where TProperty : class;
override this.Reference : string -> Microsoft.EntityFrameworkCore.ChangeTracking.ReferenceEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Reference(Of TProperty As Class) (propertyName As String) As ReferenceEntry(Of TEntity, TProperty)
類型參數
- TProperty
參數
- propertyName
- String
導覽屬性的名稱。
傳回
一個揭露該導航屬性變更追蹤資訊與操作的物件。
備註
更多資訊與範例請參閱 EF Core 中的「存取追蹤實體 」及 「變更外鍵與導覽 」。