共用方式為


ITypeMappingSource 介面

定義

核心類型對應來源。 類型對應描述提供者如何將 CLR 類型/值對應至資料庫類型/值。

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

警告:請勿直接實作此介面。 相反地,請針對非關聯式提供者衍生自 TypeMappingSourceBase ,或針對關聯式提供者衍生 'RelationalTypeMappingSource'。

public interface ITypeMappingSource
type ITypeMappingSource = interface
Public Interface ITypeMappingSource
衍生

備註

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

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

方法

FindMapping(IElementType)

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

FindMapping(IProperty)

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

FindMapping(MemberInfo)

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

FindMapping(Type)

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

FindMapping(Type, IModel)

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

FindMapping(Type, IModel, CoreTypeMapping)

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

適用於