RelationalTypeMappingSource 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
關聯式別對應來源的基類。 關聯式提供者應該衍生自這個類別並覆寫 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
- 繼承
- 實作
備註
服務存留期為 Singleton 。 這表示許多 DbContext 實例都會使用單一實例。 實作必須是安全線程。 此服務不能相依于註冊為 Scoped 的服務。
如需詳細資訊和範例,請參閱 資料庫提供者和延伸模組的實作 。
建構函式
RelationalTypeMappingSource(TypeMappingSourceDependencies, RelationalTypeMappingSourceDependencies) |
初始化這個類別的新執行個體。 |
屬性
Dependencies |
此服務的相依性。 (繼承來源 TypeMappingSourceBase) |
RelationalDependencies |
此服務的關聯式提供者特定相依性。 |
方法
明確介面實作
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) |
取得指定物件的關係資料庫類型,如果找不到對應,則會擲回。 |