I was adding some async calls in my project when i've encountered a problem. The same call between Session and AsyncSession doesn't return my document.
Here the document :
class Company {
string Id;
string Name;
BusinessUnit BusinessUnit;
}
class BusinessUnit {
string Name;
List<BusinessUnit> BusinessUnits;
List<Employee> Employees;
}
class Employee {
string Position;
string UserId;
}
class User {
string Id;
string FullName;
}
User and Company are two collections in my RavenDb. As you can see, we have a tree of business unit in our document Company. So when i want to load a Company, i make this call :
var company = Session.Include<Employee, User>(x => x.UserId)
.Load<Company>(companyId); //Working like a charm
But when i tried to do the same with Async :
var company = await AsyncSession.Include<Employee, User>(x => x.UserId)
.LoadAsync<Company>(companyId); //company is null
var company = await AsyncSession.LoadAsync<Company>(companyId); //This is working
I can't see why it isn't working.
During my searching of answers, i've found a small difference between the implementation of MultiLoaderWithInclude and AsyncMultiLoaderWithInclude. I don't know if my issue can be resolved by these classes.
Thanks for the failing test. The underlying reason is that you are using fields in there, not properties. This is a bug in the client which will be fixed shortly, but in the meantime you can use properties and avoid it entirely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With