InMemoryEntityTypeBuilderExtensions.ToInMemoryQuery Method

Definition

Overloads

ToInMemoryQuery(EntityTypeBuilder, LambdaExpression)

Configures a query used to provide data for an entity type.

ToInMemoryQuery(IConventionEntityTypeBuilder, LambdaExpression, Boolean)

Configures a query used to provide data for an entity type.

ToInMemoryQuery<TEntity>(EntityTypeBuilder<TEntity>, Expression<Func<IQueryable<TEntity>>>)

Configures a query used to provide data for an entity type.

ToInMemoryQuery(EntityTypeBuilder, LambdaExpression)

Configures a query used to provide data for an entity type.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ToInMemoryQuery (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, System.Linq.Expressions.LambdaExpression? query);
static member ToInMemoryQuery : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder * System.Linq.Expressions.LambdaExpression -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
<Extension()>
Public Function ToInMemoryQuery (entityTypeBuilder As EntityTypeBuilder, query As LambdaExpression) As EntityTypeBuilder

Parameters

entityTypeBuilder
EntityTypeBuilder

The builder for the entity type being configured.

query
LambdaExpression

The query that will provide the underlying data for the entity type.

Returns

EntityTypeBuilder

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

Remarks

See Modeling entity types and relationships, and The EF Core in-memory database provider for more information.

Applies to

ToInMemoryQuery(IConventionEntityTypeBuilder, LambdaExpression, Boolean)

Configures a query used to provide data for an entity type.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder ToInMemoryQuery (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, System.Linq.Expressions.LambdaExpression query, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? ToInMemoryQuery (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, System.Linq.Expressions.LambdaExpression? query, bool fromDataAnnotation = false);
static member ToInMemoryQuery : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * System.Linq.Expressions.LambdaExpression * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
<Extension()>
Public Function ToInMemoryQuery (entityTypeBuilder As IConventionEntityTypeBuilder, query As LambdaExpression, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

Parameters

entityTypeBuilder
IConventionEntityTypeBuilder

The builder for the entity type being configured.

query
LambdaExpression

The query that will provide the underlying data for the entity type.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionEntityTypeBuilder

The same builder instance if the query was set, null otherwise.

Remarks

See Modeling entity types and relationships, and The EF Core in-memory database provider for more information.

Applies to

ToInMemoryQuery<TEntity>(EntityTypeBuilder<TEntity>, Expression<Func<IQueryable<TEntity>>>)

Configures a query used to provide data for an entity type.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ToInMemoryQuery<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, System.Linq.Expressions.Expression<Func<System.Linq.IQueryable<TEntity>>> query) where TEntity : class;
static member ToInMemoryQuery : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> * System.Linq.Expressions.Expression<Func<System.Linq.IQueryable<'Entity>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function ToInMemoryQuery(Of TEntity As Class) (entityTypeBuilder As EntityTypeBuilder(Of TEntity), query As Expression(Of Func(Of IQueryable(Of TEntity)))) As EntityTypeBuilder(Of TEntity)

Type Parameters

TEntity

Parameters

entityTypeBuilder
EntityTypeBuilder<TEntity>

The builder for the entity type being configured.

query
Expression<Func<IQueryable<TEntity>>>

The query that will provide the underlying data for the entity type.

Returns

EntityTypeBuilder<TEntity>

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

Remarks

See Modeling entity types and relationships, and The EF Core in-memory database provider for more information.

Applies to