Reputation: 1195
I have disabled lazy load from my DbContext
base.Configuration.LazyLoadingEnabled = false;
When I use OData v3 $expand parameter, Company object isn't get filled.
http://localhost:36983/odata/Projects?$top=10&$skip=0&$expand=Company&$inlinecount=allpages
If I Enable lazy load, it get filled.
But I dont want to set Include on ProjectController like:
[EnableQuery]
public PageResult<Project> GetProjects()
{
return new PageResult<Project>(db.Project.Include("Company"));
}
This could be a Bug Issue of WebApi OData v3?
Upvotes: 1
Views: 581
Reputation: 1195
No, this isn't a bug.
I really have to Include nested objects.
Thank you.
Upvotes: 1