We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looks like FirstOrDefault() method doesn't work in combination with a discriminator. To reproduce this you can add the following tests to the file:
[Fact] public void Discriminator_FirstOrDefault() { var json1 = _rebels.FirstOrDefault().ToString(); var json2 = _simpleRebels.FirstOrDefault().ToString(); Assert.Equal(@"{""limit"":1, ""selector"":{""split_discriminator"":""Rebel""}}", json1); Assert.Equal(@"{""limit"":1, ""selector"":{""split_discriminator"":""SimpleRebel""}}", json2); } [Fact] public void Discriminator_FirstOrDefault_WithExpression() { var json1 = _rebels.FirstOrDefault(c => c.Age == 19).ToString(); var json2 = _simpleRebels.FirstOrDefault(c => c.Age == 19).ToString(); Assert.Equal(@"{""limit"":1, ""selector"":{""$and"":[{""age"":19},{""split_discriminator"":""Rebel""}]}}", json1); Assert.Equal(@"{""limit"":1, ""selector"":{""$and"":[{""age"":19},{""split_discriminator"":""SimpleRebel""}]}}", json2); }
Exception "System.IndexOutOfRangeException : Index was outside the bounds of the array." will be thrown.
The text was updated successfully, but these errors were encountered:
#136 - Fix FirstOrDefault() with discriminator
170a38a
No branches or pull requests
Looks like FirstOrDefault() method doesn't work in combination with a discriminator.
To reproduce this you can add the following tests to the file:
Exception "System.IndexOutOfRangeException : Index was outside the bounds of the array." will be thrown.
The text was updated successfully, but these errors were encountered: