RelationalEntityTypeBuilderExtensions.ToSchema Method

Definition

Configures the schema of the table that the entity type maps to when targeting a relational database.

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

Parameters

entityTypeBuilder
IConventionEntityTypeBuilder

The builder for the entity type being configured.

schema
String

The schema of the table.

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