Partilhar via


RelationalQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection Method

Definition

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 TranslateInlineQueryRoot(InlineQueryRootExpression) for the translation of inline collections.

Applies to