SqlServerModelBuilderExtensions.HasDatabaseMaxSize Method

Definition

Overloads

HasDatabaseMaxSize(ModelBuilder, String)

Configures the maximum size for Azure SQL Database.

HasDatabaseMaxSize(IConventionModelBuilder, String, Boolean)

Attempts to configure the maximum size for Azure SQL Database.

HasDatabaseMaxSize(ModelBuilder, String)

Configures the maximum size for Azure SQL Database.

public static Microsoft.EntityFrameworkCore.ModelBuilder HasDatabaseMaxSize (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string maxSize);
static member HasDatabaseMaxSize : Microsoft.EntityFrameworkCore.ModelBuilder * string -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function HasDatabaseMaxSize (modelBuilder As ModelBuilder, maxSize As String) As ModelBuilder

Parameters

modelBuilder
ModelBuilder

The model builder.

maxSize
String

The maximum size of the database.

Returns

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

Remarks

Units must be included, e.g. "100 MB". See Azure SQL Database documentation for all 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

HasDatabaseMaxSize(IConventionModelBuilder, String, Boolean)

Attempts to configure the maximum size for Azure SQL Database.

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

Parameters

modelBuilder
IConventionModelBuilder

The model builder.

maxSize
String

The maximum size 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

Units must be included, e.g. "100 MB". See Azure SQL Database documentation for all 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