ModelDependencies 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
服務相依參數類別 IModel
此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。
[System.Runtime.CompilerServices.Nullable(0)]
public sealed class ModelDependencies : IEquatable<Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies>
public sealed class ModelDependencies
public sealed class ModelDependencies : IEquatable<Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies>
[<System.Runtime.CompilerServices.Nullable(0)>]
type ModelDependencies = class
interface IEquatable<ModelDependencies>
type ModelDependencies = class
type ModelDependencies = class
interface IEquatable<ModelDependencies>
Public NotInheritable Class ModelDependencies
Implements IEquatable(Of ModelDependencies)
Public NotInheritable Class ModelDependencies
- 繼承
-
ModelDependencies
- 屬性
- 實作
備註
請勿直接從提供者代碼或應用程式代碼構造此類別的實例,因為隨著新增依賴關係,建構器簽章可能會改變。 相反地,請在建構子中使用這個型態,讓依賴注入容器自動建立並注入實例。 要建立一個替換部分依賴服務的實例,首先從相依注入容器中解析該物件,然後使用 C# 的 'with' 運算子替換所選服務。 在此過程中,切勿呼叫建構者。
服役期間為 Scoped。 這表示每個 DbContext 實例都會使用自己的服務實例。 實作方式可能取決於其他註冊於任何生命週期的服務。 實作不需要執行緒安全。
建構函式
| 名稱 | Description |
|---|---|
| ModelDependencies(IDiagnosticsLogger<DbLoggerCategory.Model>) |
這是一個內部 API,支援 Entity Framework Core 基礎架構,且不受公開 API 相同的相容性標準約束。 該內容可能會在任何新聞稿中未經通知而更改或移除。 你應該只在程式碼中直接使用它,並且要非常謹慎,並且要知道這樣做可能會導致更新到新的 Entity Framework Core 版本時應用程式失敗。 |
屬性
| 名稱 | Description |
|---|---|
| Logger |
拿到伐木機。 |
方法
| 名稱 | Description |
|---|---|
| <Clone>$() |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |
| Equals(ModelDependencies) |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |
| Equals(Object) |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |
| GetHashCode() |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |
| ToString() |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |
| With(IDiagnosticsLogger<DbLoggerCategory.Model>) |
將此相依參數物件複製,並替換一個服務。 |
運算子
| 名稱 | Description |
|---|---|
| Equality(ModelDependencies, ModelDependencies) |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |
| Inequality(ModelDependencies, ModelDependencies) |
服務相依參數類別 IModel 此類型通常由資料庫提供者(及其他擴充功能)使用。 它通常不被用於應用程式程式碼中。 |