Compartir a través de


Métodos de restricción y proyección (LINQ to Entities)

La mayoría de los métodos de restricción y proyección de LINQ se admiten en las consultas de LINQ to Entities, con la excepción de las que aceptan un argumento de posición. Para obtener más información, vea Operadores de consulta estándar en las consultas de LINQ to Entities. En la tabla siguiente se enumeran los métodos de restricción y proyección admitidos y no admitidos.

Métodos admitidos y no admitidos

Método Admisión Firma de funciones de Visual Basic Firma de métodos de C#

Select

Admitido

Function Select(Of TSource, TResult) ( _
source As IQueryable(Of TSource), _
selector As Expression(Of Func(Of TSource, TResult)) _
) As IQueryable(Of TResult)
IQueryable<TResult> Select<TSource, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, TResult>> selector
)

Select

No admitido

Function Select(Of TSource, TResult) ( _
source As IQueryable(Of TSource), _
selector As Expression(Of Func(Of TSource, Integer, TResult)) _
) As IQueryable(Of TResult)
IQueryable<TResult> Select<TSource, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, int, TResult>> selector
)

SelectMany

Admitido

Function SelectMany(Of TSource, TResult) ( _
source As IQueryable(Of TSource), _
selector As Expression(Of Func(Of TSource, IEnumerable(Of TResult))) _
) As IQueryable(Of TResult)
IQueryable<TResult> SelectMany<TSource, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, IEnumerable<TResult>>> selector
)

SelectMany

No admitido

Function SelectMany(Of TSource, TResult) ( _
source As IQueryable(Of TSource), _
selector As Expression(Of Func(Of TSource, Integer, IEnumerable(Of TResult))) _
) As IQueryable(Of TResult)
IQueryable<TResult> SelectMany<TSource, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, int, IEnumerable<TResult>>> selector
)

SelectMany

Admitido

Function SelectMany(Of TSource, TCollection, TResult) ( _
source As IQueryable(Of TSource), _
collectionSelector As Expression(Of Func(Of TSource, IEnumerable(Of TCollection))), _
resultSelector As Expression(Of Func(Of TSource, TCollection, TResult)) _
) As IQueryable(Of TResult)
IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector,
Expression<Func<TSource, TCollection, TResult>> resultSelector
)

SelectMany

No admitido

Function SelectMany(Of TSource, TCollection, TResult) ( _
source As IQueryable(Of TSource), _
collectionSelector As Expression(Of Func(Of TSource, Integer, IEnumerable(Of TCollection))), _
resultSelector As Expression(Of Func(Of TSource, TCollection, TResult)) _
) As IQueryable(Of TResult)
IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector,
Expression<Func<TSource, TCollection, TResult>> resultSelector
)

Where

Admitido

Function Where(Of TSource) ( _
source As IQueryable(Of TSource), _
predicate As Expression(Of Func(Of TSource, Boolean)) _
) As IQueryable(Of TSource)
IQueryable<TSource> Where<TSource>(
this IQueryable<TSource> source,
Expression<Func<TSource, bool>> predicate
)

Where

No admitido

Function Where(Of TSource) ( _
source As IQueryable(Of TSource), _
predicate As Expression(Of Func(Of TSource, Integer, Boolean)) _
) As IQueryable(Of TSource)
IQueryable<TSource> Where<TSource>(
this IQueryable<TSource> source,
Expression<Func<TSource, int, bool>> predicate
)

Vea también

Conceptos

Métodos admitidos y no admitidos (LINQ to Entities)