Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print expression when throwing null type mapping in SQL tree #22360

Merged
merged 1 commit into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/EFCore.Cosmos/Properties/CosmosStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<value>There is no string-based representation of this query as it's executed using 'ReadItemQueryAsync({resourceId}, {partitionKey})'.</value>
</data>
<data name="NullTypeMappingInSqlTree" xml:space="preserve">
<value>Null TypeMapping in SQL tree.</value>
<value>Expression '{sqlExpression}' in SQL tree does not have type mapping assigned.</value>
</data>
<data name="OffsetRequiresLimit" xml:space="preserve">
<value>Offset is not supported without Limit.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ protected override Expression VisitExtension(Expression extensionExpression)
if (extensionExpression is SqlExpression sqlExpression
&& sqlExpression.TypeMapping == null)
{
throw new InvalidOperationException(CosmosStrings.NullTypeMappingInSqlTree);
throw new InvalidOperationException(CosmosStrings.NullTypeMappingInSqlTree(sqlExpression.Print()));
}

return base.VisitExtension(extensionExpression);
Expand Down
12 changes: 8 additions & 4 deletions src/EFCore.Relational/Properties/RelationalStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/EFCore.Relational/Properties/RelationalStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
<value>Nullability information should only be specified for scalar database functions.</value>
</data>
<data name="NullTypeMappingInSqlTree" xml:space="preserve">
<value>Null TypeMapping in SQL tree.</value>
<value>Expression '{sqlExpression}' in SQL tree does not have type mapping assigned.</value>
</data>
<data name="ParameterNotObjectArray" xml:space="preserve">
<value>Cannot use the value provided for parameter '{parameter}' because it isn't assignable to type object[].</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ protected override Expression VisitExtension(Expression extensionExpression)
{
if (sqlExpression.TypeMapping == null)
{
throw new InvalidOperationException(RelationalStrings.NullTypeMappingInSqlTree);
throw new InvalidOperationException(RelationalStrings.NullTypeMappingInSqlTree(sqlExpression.Print()));
}
}

Expand Down