Jet seems to output bytes only as an array. so a single byte becomes a byte[1] array. Return the first byte of that array in this instance

pull/137/head
Christopher Jolly 3 years ago
parent 3b0bc7d5ad
commit 9489bc4564

@ -93,6 +93,8 @@ namespace EntityFrameworkCore.Jet.Data
if (value is byte byteValue)
return byteValue;
if (value is byte[] byteArrayValue)
return byteArrayValue[0];
if (value is sbyte sbyteValue)
return checked((byte)sbyteValue);
if (value is short shortValue)

@ -359,7 +359,7 @@ WHERE `a`.`Discriminator` = 'Kiwi'");
await base.Byte_enum_value_constant_used_in_projection(async);
AssertSql(
@"SELECT IIF(`a`.`IsFlightless` = TRUE, 0, 1)
@"SELECT IIF(`a`.`IsFlightless` = TRUE, 0x00, 0x01)
FROM `Animals` AS `a`
WHERE `a`.`Discriminator` = 'Kiwi'");
}

@ -910,7 +910,7 @@ FROM `Orders` AS `o`
await base.Select_byte_constant(isAsync);
AssertSql(
$@"SELECT IIF(`c`.`CustomerID` = 'ALFKI', 1, 2)
$@"SELECT IIF(`c`.`CustomerID` = 'ALFKI', 0x01, 0x02)
FROM `Customers` AS `c`");
}

Loading…
Cancel
Save