RelationalModelBuilderExtensions.HasDefaultSchema Method

Definition

Overloads

HasDefaultSchema(IConventionModelBuilder, String, Boolean)

Configures the default schema that database objects should be created in, if no schema is explicitly configured.

HasDefaultSchema(ModelBuilder, String)

Configures the default schema that database objects should be created in, if no schema is explicitly configured.

HasDefaultSchema(IConventionModelBuilder, String, Boolean)

Configures the default schema that database objects should be created in, if no schema is explicitly configured.

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

Parameters

modelBuilder
IConventionModelBuilder

The model builder.

schema
String

The default schema.

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 Modeling entity types and relationships for more information and examples.

Applies to

HasDefaultSchema(ModelBuilder, String)

Configures the default schema that database objects should be created in, if no schema is explicitly configured.

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

Parameters

modelBuilder
ModelBuilder

The model builder.

schema
String

The default schema.

Returns

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

Remarks

See Modeling entity types and relationships for more information and examples.

Applies to