RelationalEntityTypeBuilderExtensions.ToSqlQuery Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ToSqlQuery(IConventionEntityTypeBuilder, String, Boolean) |
Configures a SQL string used to provide data for the entity type. |
ToSqlQuery(EntityTypeBuilder, String) |
Configures a SQL string used to provide data for the entity type. |
ToSqlQuery<TEntity>(EntityTypeBuilder<TEntity>, String) |
Configures a SQL string used to provide data for the entity type. |
ToSqlQuery(IConventionEntityTypeBuilder, String, Boolean)
Configures a SQL string used to provide data for the entity type.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder ToSqlQuery (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string name, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? ToSqlQuery (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);
static member ToSqlQuery : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
<Extension()>
Public Function ToSqlQuery (entityTypeBuilder As IConventionEntityTypeBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder
Parameters
- entityTypeBuilder
- IConventionEntityTypeBuilder
The builder for the entity type being configured.
- name
- String
The SQL query that will provide the underlying data for the entity type.
- 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
ToSqlQuery(EntityTypeBuilder, String)
Configures a SQL string used to provide data for the entity type.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ToSqlQuery (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, string query);
static member ToSqlQuery : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
<Extension()>
Public Function ToSqlQuery (entityTypeBuilder As EntityTypeBuilder, query As String) As EntityTypeBuilder
Parameters
- entityTypeBuilder
- EntityTypeBuilder
The builder for the entity type being configured.
- query
- String
The SQL query that will provide the underlying data for the entity type.
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
ToSqlQuery<TEntity>(EntityTypeBuilder<TEntity>, String)
Configures a SQL string used to provide data for the entity type.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ToSqlQuery<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, string query) where TEntity : class;
static member ToSqlQuery : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function ToSqlQuery(Of TEntity As Class) (entityTypeBuilder As EntityTypeBuilder(Of TEntity), query As String) As EntityTypeBuilder(Of TEntity)
Type Parameters
- TEntity
Parameters
- entityTypeBuilder
- EntityTypeBuilder<TEntity>
The builder for the entity type being configured.
- query
- String
The SQL query that will provide the underlying data for the entity type.
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