共用方式為


TypeMappingSourceBase 類別

定義

非關聯式別對應來源的基類。 非關聯式提供者應該衍生自此類別並覆寫 TypeMappingSourceBase.FindMapping

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

public abstract class TypeMappingSourceBase : Microsoft.EntityFrameworkCore.Storage.ITypeMappingSource
type TypeMappingSourceBase = class
    interface ITypeMappingSource
Public MustInherit Class TypeMappingSourceBase
Implements ITypeMappingSource
繼承
TypeMappingSourceBase
衍生
實作

備註

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

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

建構函式

TypeMappingSourceBase(TypeMappingSourceDependencies)

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

屬性

Dependencies

此服務的相依性。

方法

FindMapping(IElementType)

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

FindMapping(IProperty)

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

FindMapping(MemberInfo)

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

FindMapping(Type)

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

FindMapping(Type, IModel)

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

FindMapping(Type, IModel, CoreTypeMapping)

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

FindMapping(TypeMappingInfo)

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

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

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

ValidateMapping(CoreTypeMapping, IProperty)

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

適用於