1

Closed

OData $filter returns incorrect results for byte arrays when using Linq2Objects

description

$filter=BinaryProp eq binary'010203'
doesn't work even if BinaryProp is new byte[] { 1, 2, 3 }.

This is due to the fact that the expression that we generate does a reference equals i.e it looks like
$it.BinaryProp == new Byte[] { 1. 2. 3 }

The exact same filter works fine with Linq2SQL and EF as they translate the equals expression to the right SQL.
Closed Oct 18, 2012 at 8:41 PM by hongyes
Verified in latest build

comments

HongmeiG wrote Sep 10, 2012 at 10:38 PM

We need to translate the expression differently for Linq2SQL.