SqlServerStoreGenerationConvention 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
一種確保屬性不會設定為預設值的慣例,無論是計算欄位還是同時使用 a SqlServerValueGenerationStrategy 。
[System.Runtime.CompilerServices.Nullable(0)]
public class SqlServerStoreGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.StoreGenerationConvention
public class SqlServerStoreGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.StoreGenerationConvention
[<System.Runtime.CompilerServices.Nullable(0)>]
type SqlServerStoreGenerationConvention = class
inherit StoreGenerationConvention
type SqlServerStoreGenerationConvention = class
inherit StoreGenerationConvention
Public Class SqlServerStoreGenerationConvention
Inherits StoreGenerationConvention
- 繼承
- 屬性
備註
更多資訊與範例請參閱模型建構慣例,以及使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫。
建構函式
| 名稱 | Description |
|---|---|
| SqlServerStoreGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies) |
建立一個新的 實例。SqlServerStoreGenerationConvention |
屬性
| 名稱 | Description |
|---|---|
| Dependencies |
此服務的依賴關係。 (繼承來源 StoreGenerationConvention) |
| RelationalDependencies |
此服務的關聯提供者專屬相依關係。 (繼承來源 StoreGenerationConvention) |
方法
| 名稱 | Description |
|---|---|
| ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>) |
模型最終定案後才會被通知。 (繼承來源 StoreGenerationConvention) |
| ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>) |
當模型正在定案時會被召喚。 (繼承來源 StoreGenerationConvention) |
| ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>) |
在屬性的註解被更改後呼叫。 |
| Validate(IConventionProperty, StoreObjectIdentifier) |
如果這個屬性的商店生成設定有衝突,則會丟出。 |
| Validate(IConventionProperty) |
一種確保屬性不會設定為預設值的慣例,無論是計算欄位還是同時使用 a SqlServerValueGenerationStrategy 。 |