SqlServerModelBuilderExtensions.HasServiceTierSql Method

Definition

Overloads

HasServiceTierSql(ModelBuilder, String)

Configures the service tier (EDITION) for Azure SQL Database as a SQL expression.

HasServiceTierSql(IConventionModelBuilder, String, Boolean)

Attempts to configure the service tier (EDITION) for Azure SQL Database.

HasServiceTierSql(ModelBuilder, String)

Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs

Configures the service tier (EDITION) for Azure SQL Database as a SQL expression.

C#
public static Microsoft.EntityFrameworkCore.ModelBuilder HasServiceTierSql (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string serviceTier);

Parameters

modelBuilder
ModelBuilder

The model builder.

serviceTier
String

The expression for the service tier of the database.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Azure SQL Database documentation for supported values.

See Modeling entity types and relationships, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

HasServiceTierSql(IConventionModelBuilder, String, Boolean)

Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs

Attempts to configure the service tier (EDITION) for Azure SQL Database.

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder HasServiceTierSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string serviceTier, bool fromDataAnnotation = false);
C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder? HasServiceTierSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string? serviceTier, bool fromDataAnnotation = false);

Parameters

modelBuilder
IConventionModelBuilder

The model builder.

serviceTier
String

The expression for the service tier of the database.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Remarks

See Azure SQL Database documentation for supported values.

See Modeling entity types and relationships, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 3.1, 5.0, 6.0, 7.0, 8.0, 9.0