共用方式為


RelationalTypeMappingSource 類別

定義

關聯式別對應來源的基類。 關聯式提供者應該衍生自這個類別並覆寫 Microsoft.EntityFrameworkCore.Storage.RelationalTypeMappingSource.FindMapping(Microsoft.EntityFrameworkCore.Storage.RelationalTypeMappingInfo@)

此類型通常是由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

public abstract class RelationalTypeMappingSource : Microsoft.EntityFrameworkCore.Storage.TypeMappingSourceBase, Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMappingSource
type RelationalTypeMappingSource = class
    inherit TypeMappingSourceBase
    interface IRelationalTypeMappingSource
    interface ITypeMappingSource
Public MustInherit Class RelationalTypeMappingSource
Inherits TypeMappingSourceBase
Implements IRelationalTypeMappingSource
繼承
RelationalTypeMappingSource
實作

備註

服務存留期為 Singleton 。 這表示許多 DbContext 實例都會使用單一實例。 實作必須是安全線程。 此服務不能相依于註冊為 Scoped 的服務。

如需詳細資訊和範例,請參閱 資料庫提供者和延伸模組的實作

建構函式

RelationalTypeMappingSource(TypeMappingSourceDependencies, RelationalTypeMappingSourceDependencies)

初始化這個類別的新執行個體。

屬性

Dependencies

此服務的相依性。

(繼承來源 TypeMappingSourceBase)
RelationalDependencies

此服務的關聯式提供者特定相依性。

方法

FindCollectionMapping(RelationalTypeMappingInfo, Type, Type, CoreTypeMapping)

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

FindMapping(IElementType)

尋找指定 IElementType 之 的型別對應。

FindMapping(IElementType)

尋找指定 IElementType 之 的型別對應。

(繼承來源 TypeMappingSourceBase)
FindMapping(IProperty)

尋找指定 IProperty 之 的型別對應。

FindMapping(MemberInfo)

尋找代表 CLR 型別之欄位或屬性的指定 MemberInfo 型別對應。

FindMapping(RelationalTypeMappingInfo)

由關係資料庫提供者覆寫,以尋找指定資訊的型別對應。

FindMapping(String)

尋找指定資料庫類型名稱的類型對應。

FindMapping(Type)

尋找指定 Type 之 的型別對應。

FindMapping(Type, IModel)

尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。

FindMapping(Type, IModel)

尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。

(繼承來源 TypeMappingSourceBase)
FindMapping(Type, IModel, CoreTypeMapping)

尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。

FindMapping(Type, IModel, CoreTypeMapping)

尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。

(繼承來源 TypeMappingSourceBase)
FindMapping(Type, String, Boolean, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>)

尋找指定 Type 和其他 Facet 的類型對應。

FindMapping(TypeMappingInfo)

請改為呼叫 Microsoft.EntityFrameworkCore.Storage.RelationalTypeMappingSource.FindMapping(Microsoft.EntityFrameworkCore.Storage.RelationalTypeMappingInfo@)

FindMappingWithConversion(RelationalTypeMappingInfo, IReadOnlyList<IProperty>)

此 API 支援 Entity Framework Core 基礎結構,並不適合直接從您的程式碼使用。 此 API 可能會在未來的版本中變更或移除。

ParseStoreTypeName(String, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>)

剖析提供者特定的存放區類型名稱,擷取標準 Facet (例如大小、有效位數) ,並傳回基底存放區類型名稱 (,而不需任何 facet) 。

TryFindJsonCollectionMapping(TypeMappingInfo, Type, Type, CoreTypeMapping, ValueComparer, JsonValueReaderWriter)

嘗試尋找基本型別集合的 JSON 型別對應。

(繼承來源 TypeMappingSourceBase)
ValidateMapping(CoreTypeMapping, IProperty)

在找到對應之後呼叫,以便針對指定的屬性進行驗證。

(繼承來源 TypeMappingSourceBase)

明確介面實作

IRelationalTypeMappingSource.FindMapping(IProperty)

尋找指定 IProperty 之 的型別對應。

IRelationalTypeMappingSource.FindMapping(MemberInfo)

尋找代表 CLR 型別之欄位或屬性的指定 MemberInfo 型別對應。

IRelationalTypeMappingSource.FindMapping(Type)

尋找指定 Type 之 的型別對應。

IRelationalTypeMappingSource.FindMapping(Type, IModel)

尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。

擴充方法

GetMapping(IRelationalTypeMappingSource, IProperty)

取得指定屬性的關係資料庫類型,如果在找不到對應時擲回。

GetMapping(IRelationalTypeMappingSource, String)

取得表示指定資料庫類型的對應,如果在找不到對應時擲回。

GetMapping(IRelationalTypeMappingSource, Type)

取得指定 .NET 類型的關係資料庫類型,如果在找不到對應時擲回。

GetMapping(IRelationalTypeMappingSource, Type, IModel)

取得指定 .NET 類型的關係資料庫類型,如果在找不到對應時擲回。

GetMappingForValue(IRelationalTypeMappingSource, Object)

取得指定物件的關係資料庫類型,如果找不到對應,則會擲回。

GetMappingForValue(IRelationalTypeMappingSource, Object, IModel)

取得指定物件的關係資料庫類型,如果找不到對應,則會擲回。

適用於