Skip to content

Commit

Permalink
Fix a return error issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chinadragon0515 committed Aug 2, 2016
1 parent 6b061d8 commit a801c05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Microsoft.Restier.Core/Query/DefaultQueryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private static MethodCallExpression CheckWhereCondition(MethodCallExpression met

// Key segment will have ConstantExpression but $filter will not have ConstantExpression
var rightExpression = binaryExpression.Right as ConstantExpression;
if (rightExpression != null)
if (rightExpression != null && rightExpression.Value != null)
{
// This means where statement is key segment but not for $filter
throw new ResourceNotFoundException(Resources.ResourceNotFound);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ public void QueryNullRawEnumPropertyOfSingleEntity()
[Theory]
// Filter with no result, them empty collection returned.
[InlineData("/People?$filter=LastName eq 'xxx'", 200)]
// No result, should return empty collection
[InlineData("/People?$filter=LastName eq null", 200)]
// Filter cause no result returned.
[InlineData("/People(1)?$filter=LastName eq 'xxx'", 204)]
// Single primitive property with null value
Expand Down

0 comments on commit a801c05

Please sign in to comment.