Navigation Menu

Skip to content
New issue

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

[BUG] Include ignored with Query instruction #1774

Closed
animha opened this issue Aug 3, 2020 · 2 comments
Closed

[BUG] Include ignored with Query instruction #1774

animha opened this issue Aug 3, 2020 · 2 comments
Labels

Comments

@animha
Copy link

animha commented Aug 3, 2020

Hello,

I'm using LiteDb 5.0.8, in a NetCore 3.1 application.

I'm encountered a strange issue working with BsonRef.

I have an object A, which contains a list of objects B (BsonRef):
[BsonRef] public List<B> Bees { get; set; }

If I load an instance of A, using:
db.GetCollection<A>() .Include(a=>a.Bees) .FindById(....)

I get my instance, with my property "Bees" fully polulated.

If I load the same instance using Query() instruction:
db.GetCollection<A>() .Include(a=>a.Bees) .Query() .Where(a=>.....) .ToList()

The collection "Bees" is populated with only the keys of the objects, but all other B's properties are null (in other words: the "Include" instruction is somehow ignored).

Is this an expected behaviour?

@animha animha added the bug label Aug 3, 2020
@animha animha changed the title [BUG] [BUG] Include ignored with Query instruction Aug 3, 2020
@lbnascimento
Copy link
Collaborator

@animha This issue has been fixed in the master and its fix will be present in the next incremental release.

In the meantime, you can call Include after Query and it should work.

@animha
Copy link
Author

animha commented Aug 4, 2020

Wonderful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants