Skip to content

Commit 41baf73

Browse files
committed
Handle enum for generic Contains method
1 parent 6e1f709 commit 41baf73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Microsoft.OData.Client/ALinq/ExpressionWriter.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,13 @@ internal override Expression VisitConstant(ConstantExpression c)
561561

562562
try
563563
{
564-
uriLiteral = LiteralFormatter.ForConstants.Format(item);
564+
object currentValue = item;
565+
if (item.GetType().IsEnum)
566+
{
567+
currentValue = item.ToString();
568+
}
569+
570+
uriLiteral = LiteralFormatter.ForConstants.Format(currentValue);
565571
}
566572
catch (InvalidOperationException)
567573
{

0 commit comments

Comments
 (0)