SqlServerModelBuilderExtensions.CanSetServiceTierSql 方法

定義

傳回值,指出指定的值是否可以設定為資料庫的服務層級。

public static bool CanSetServiceTierSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string serviceTier, bool fromDataAnnotation = false);
public static bool CanSetServiceTierSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string? serviceTier, bool fromDataAnnotation = false);
static member CanSetServiceTierSql : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * string * bool -> bool
<Extension()>
Public Function CanSetServiceTierSql (modelBuilder As IConventionModelBuilder, serviceTier As String, Optional fromDataAnnotation As Boolean = false) As Boolean

參數

modelBuilder
IConventionModelBuilder

模型產生器。

serviceTier
String

資料庫的服務層級運算式。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

true 如果指定的值可以設定為資料庫的服務層級,則為 。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於