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)

Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs

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

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

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

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

HasDefaultSchema(ModelBuilder, String)

Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs
Source:
RelationalModelBuilderExtensions.cs

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

C#
public static Microsoft.EntityFrameworkCore.ModelBuilder HasDefaultSchema (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string schema);
C#
public static Microsoft.EntityFrameworkCore.ModelBuilder HasDefaultSchema (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string? schema);

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

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0