Details
-
Bug
-
Resolution: Fixed
-
Unknown
-
None
-
None
-
None
-
Fully Compatible
-
Not Needed
-
Description
Usage of unary negation operator is throwing ExpressionNotSupportedException exception. Code to reproduce:
public class MathNegationTests : Linq3IntegrationTest |
{
|
[Fact]
|
public void Math_negation() |
{
|
var collection = CreateCollection();
|
|
|
var query = collection.AsQueryable()
|
.Where(i => -i.A == 10); |
|
|
var results = query.ToList();
|
|
|
results.Should().OnlyContain(i => -i.A == 10); |
}
|
|
|
private IMongoCollection<Data> CreateCollection() |
{
|
var collection = GetCollection<Data>("test"); |
CreateCollection(
|
collection,
|
new Data { A = -10 }, |
new Data { A = 5 }); |
return collection; |
}
|
|
|
private class Data |
{
|
public int A { get; set; } |
}
|
}
|