Skip to content

Commit 0337844

Browse files
committed
Move error messages to resources
1 parent f45717f commit 0337844

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Orm/Xtensive.Orm/Orm/Linq/Translator.Expressions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ protected override Expression VisitBinary(BinaryExpression binaryExpression)
195195
if ((context.Evaluator.CanBeEvaluated(binaryExpression.Right) && !(binaryExpression.Right is ConstantExpression))
196196
|| (context.Evaluator.CanBeEvaluated(binaryExpression.Left) && !(binaryExpression.Left is ConstantExpression)))
197197
throw new NotSupportedException(
198-
string.Format("Coalesce expressions with constant values of {0} type are not supported", memberType.ToString()));
198+
string.Format(Strings.ExXExpressionsWithConstantValuesOfYTypeNotSupported,"Coalesce", memberType.ToString()));
199199

200200
return Visit(Expression.Condition(
201201
Expression.NotEqual(binaryExpression.Left, Expression.Constant(null)),
@@ -241,7 +241,7 @@ protected override Expression VisitConditional(ConditionalExpression c)
241241
if (memberType == MemberType.Entity || memberType == MemberType.Structure) {
242242
if ((context.Evaluator.CanBeEvaluated(c.IfFalse) && !(c.IfFalse is ConstantExpression))
243243
|| (context.Evaluator.CanBeEvaluated(c.IfTrue) && !(c.IfTrue is ConstantExpression)))
244-
throw new NotSupportedException(string.Format("Conditional expressions with constant values of {0} type are not supported.", memberType.ToString()));
244+
throw new NotSupportedException(string.Format(Strings.ExXExpressionsWithConstantValuesOfYTypeNotSupported, "Conditional", memberType.ToString()));
245245
}
246246
return base.VisitConditional(c);
247247
}

Orm/Xtensive.Orm/Strings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Orm/Xtensive.Orm/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,4 +3470,7 @@ Error: {1}</value>
34703470
<data name="ExConnectionAccessorXHasNoParameterlessConstructor" xml:space="preserve">
34713471
<value>Connection accessor '{0}' has no parameterless constructor.</value>
34723472
</data>
3473+
<data name="ExXExpressionsWithConstantValuesOfYTypeNotSupported" xml:space="preserve">
3474+
<value>{0} expressions with constant values of {1} type are not supported.</value>
3475+
</data>
34733476
</root>

0 commit comments

Comments
 (0)