Skip to content

Commit

Permalink
Move RelationalStrings.NoElements exception message to core
Browse files Browse the repository at this point in the history
Fixes #16164
  • Loading branch information
ajcvickers committed Jul 27, 2019
1 parent b9653e8 commit 07eafb6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Storage;
Expand Down Expand Up @@ -747,8 +748,7 @@ private ShapedQueryExpression AggregateResultShaper(
Expression.New(
typeof(InvalidOperationException).GetConstructors()
.Single(ci => ci.GetParameters().Length == 1),
// TODO: See issue#16164
Expression.Constant("Insert exception message here")),
Expression.Constant(CoreStrings.NoElements)),
resultType),
resultType != resultVariable.Type
? Expression.Convert(resultVariable, resultType)
Expand Down

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

3 changes: 0 additions & 3 deletions src/EFCore.Relational/Properties/RelationalStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@
<data name="UnsupportedPropertyType" xml:space="preserve">
<value>No mapping to a relational type can be found for property '{entity}.{property}' with the CLR type '{clrType}'.</value>
</data>
<data name="NoElements" xml:space="preserve">
<value>Sequence contains no elements.</value>
</data>
<data name="LogConnectionErrorAsDebug" xml:space="preserve">
<value>An error occurred using the connection to database '{database}' on server '{server}'.</value>
<comment>Debug RelationalEventId.ConnectionError string string</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ private ShapedQueryExpression AggregateResultShaper(
Expression.New(
typeof(InvalidOperationException).GetConstructors()
.Single(ci => ci.GetParameters().Length == 1),
Expression.Constant(RelationalStrings.NoElements)),
Expression.Constant(CoreStrings.NoElements)),
resultType),
resultType != resultVariable.Type
? Expression.Convert(resultVariable, resultType)
Expand Down
6 changes: 6 additions & 0 deletions src/EFCore/Properties/CoreStrings.Designer.cs

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

3 changes: 3 additions & 0 deletions src/EFCore/Properties/CoreStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<data name="ModelNotFinalized" xml:space="preserve">
<value>The model must be finalized before '{method}' can be used. Ensure that either 'OnModelCreating' has completed or, if using a stand-alone 'ModelBuilder', that 'FinalizeModel' has been called.</value>
</data>
<data name="NoElements" xml:space="preserve">
<value>Sequence contains no elements.</value>
</data>
<data name="InvalidEnumValue" xml:space="preserve">
<value>The value provided for argument '{argumentName}' must be a valid value of enum type '{enumType}'.</value>
</data>
Expand Down

0 comments on commit 07eafb6

Please sign in to comment.