IRelationalTypeMappingSource 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
關聯式別對應來源。 類型對應描述提供者如何將 CLR 類型/值對應至資料庫類型/值。
此類型通常是由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。
警告:請勿直接實作此介面。 相反地,請衍生自 RelationalTypeMappingSource 。
public interface IRelationalTypeMappingSource : Microsoft.EntityFrameworkCore.Storage.ITypeMappingSource
type IRelationalTypeMappingSource = interface
interface ITypeMappingSource
Public Interface IRelationalTypeMappingSource
Implements ITypeMappingSource
- 衍生
- 實作
備註
服務存留期為 Singleton 。 這表示許多 DbContext 實例都會使用單一實例。 實作必須是安全線程。 此服務不能相依于註冊為 Scoped 的服務。
如需詳細資訊和範例,請參閱 資料庫提供者和延伸模組的實作 。
方法
FindMapping(IElementType) |
尋找指定 IElementType 之 的型別對應。 (繼承來源 ITypeMappingSource) |
FindMapping(IProperty) |
尋找指定 IProperty 之 的型別對應。 |
FindMapping(MemberInfo) |
尋找代表 CLR 型別之欄位或屬性的指定 MemberInfo 型別對應。 |
FindMapping(String) |
尋找指定資料庫類型名稱的類型對應。 |
FindMapping(Type) |
尋找指定 Type 之 的型別對應。 |
FindMapping(Type, IModel) |
尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。 |
FindMapping(Type, IModel, CoreTypeMapping) |
尋找指定 Type 之 的型別對應,並將預先慣例組態納入帳戶中。 |
FindMapping(Type, String, Boolean, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>) |
尋找指定 Type 和其他 Facet 的類型對應。 |
擴充方法
GetMapping(IRelationalTypeMappingSource, IProperty) |
取得指定屬性的關係資料庫類型,如果在找不到對應時擲回。 |
GetMapping(IRelationalTypeMappingSource, String) |
取得表示指定資料庫類型的對應,如果在找不到對應時擲回。 |
GetMapping(IRelationalTypeMappingSource, Type) |
取得指定 .NET 類型的關係資料庫類型,如果在找不到對應時擲回。 |
GetMapping(IRelationalTypeMappingSource, Type, IModel) |
取得指定 .NET 類型的關係資料庫類型,如果在找不到對應時擲回。 |
GetMappingForValue(IRelationalTypeMappingSource, Object) |
取得指定物件的關係資料庫類型,如果找不到對應,則會擲回。 |
GetMappingForValue(IRelationalTypeMappingSource, Object, IModel) |
取得指定物件的關係資料庫類型,如果找不到對應,則會擲回。 |