CosmosJsonIdConvention 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
一個將 PK 和/或判別子屬性映射到 JSON 'id' 屬性的慣例。
[System.Runtime.CompilerServices.Nullable(0)]
public class CosmosJsonIdConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IDiscriminatorPropertySetConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyRemovedConvention
[<System.Runtime.CompilerServices.Nullable(0)>]
type CosmosJsonIdConvention = class
interface IEntityTypeAddedConvention
interface IConvention
interface IEntityTypeBaseTypeChangedConvention
interface IEntityTypeAnnotationChangedConvention
interface IForeignKeyOwnershipChangedConvention
interface IKeyAddedConvention
interface IKeyRemovedConvention
interface IPropertyAddedConvention
interface IPropertyRemovedConvention
interface IPropertyAnnotationChangedConvention
interface IModelAnnotationChangedConvention
interface IDiscriminatorPropertySetConvention
Public Class CosmosJsonIdConvention
Implements IDiscriminatorPropertySetConvention, IEntityTypeAddedConvention, IEntityTypeAnnotationChangedConvention, IEntityTypeBaseTypeChangedConvention, IForeignKeyOwnershipChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelAnnotationChangedConvention, IPropertyAddedConvention, IPropertyAnnotationChangedConvention, IPropertyRemovedConvention
- 繼承
-
CosmosJsonIdConvention
- 屬性
- 實作
-
IConvention IDiscriminatorPropertySetConvention IEntityTypeAddedConvention IEntityTypeAnnotationChangedConvention IEntityTypeBaseTypeChangedConvention IForeignKeyOwnershipChangedConvention IKeyAddedConvention IKeyRemovedConvention IModelAnnotationChangedConvention IPropertyAddedConvention IPropertyAnnotationChangedConvention IPropertyRemovedConvention
備註
更多資訊與範例請參閱模型建構慣例,以及使用 EF Core 存取 Azure Cosmos DB。
建構函式
| 名稱 | Description |
|---|---|
| CosmosJsonIdConvention(ProviderConventionSetBuilderDependencies, IJsonIdDefinitionFactory) |
建立一個新的 實例。CosmosJsonIdConvention |
欄位
| 名稱 | Description |
|---|---|
| DefaultIdPropertyName |
這是一個內部 API,支援 Entity Framework Core 基礎架構,且不受公開 API 相同的相容性標準約束。 該內容可能會在任何新聞稿中未經通知而更改或移除。 你應該只在程式碼中直接使用它,並且要非常謹慎,並且要知道這樣做可能會導致更新到新的 Entity Framework Core 版本時應用程式失敗。 |
| IdPropertyJsonName |
這是一個內部 API,支援 Entity Framework Core 基礎架構,且不受公開 API 相同的相容性標準約束。 該內容可能會在任何新聞稿中未經通知而更改或移除。 你應該只在程式碼中直接使用它,並且要非常謹慎,並且要知道這樣做可能會導致更新到新的 Entity Framework Core 版本時應用程式失敗。 |
屬性
| 名稱 | Description |
|---|---|
| DefinitionFactory |
工廠會為每個實體類型建立一個 Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal.IJsonIdDefinition 。 |
| Dependencies |
此服務的依賴關係。 |