RelationalQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection 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.
Translates a parameter or column collection of primitive values. Providers can override this to translate e.g. int[] columns or
parameters to a queryable table (OPENJSON on SQL Server, unnest on PostgreSQL...). The default implementation always returns
null
(no translation).
protected virtual Microsoft.EntityFrameworkCore.Query.ShapedQueryExpression? TranslatePrimitiveCollection (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression sqlExpression, Microsoft.EntityFrameworkCore.Metadata.IProperty? property, string tableAlias);
abstract member TranslatePrimitiveCollection : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Metadata.IProperty * string -> Microsoft.EntityFrameworkCore.Query.ShapedQueryExpression
override this.TranslatePrimitiveCollection : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Metadata.IProperty * string -> Microsoft.EntityFrameworkCore.Query.ShapedQueryExpression
Protected Overridable Function TranslatePrimitiveCollection (sqlExpression As SqlExpression, property As IProperty, tableAlias As String) As ShapedQueryExpression
Parameters
- sqlExpression
- SqlExpression
The expression to try to translate as a primitive collection expression.
- property
- IProperty
If the primitive collection is a property, contains the IProperty for that property. Otherwise, the collection
represents a parameter, and this contains null
.
- tableAlias
- String
Provides an alias to be used for the table returned from translation, which will represent the collection.
Returns
A ShapedQueryExpression if the translation was successful, otherwise null
.
Remarks
Inline collections aren't passed to this method; see VisitInlineQueryRoot(InlineQueryRootExpression) for the translation of inline collections.
Applies to
Entity Framework