AspNetCoreOData
AspNetCoreOData copied to clipboard
Auto expand doesn't work for the nested expanded entities using $expand
trafficstars
When applying the AutomaticallyExpand or [AutoExpand] for a navigation property, the expected behavior is to expand it automatically. It works when getting the entity from root level, but it doesn't work if the entity is expanded by a $expand clause.
The previous ODATA version I used was 5.11.0 and it worked normally. But after upgrading to the version 8, it doesn't work anymore.
public class Book
{
public int Id {get; set; }
public Author Author{get;set;}
}
public class Author
{
public int Id{get;set;}
[AutoExpand]
public IList<Address> Addresses{get;set;}
}
public class Address
{
public int Id{get;set;}
public string Address{get;set;}
}
...
GET /odata/Authors
Successfully expands the Addresses of the Authors.
GET /odata/Books?$expand=Author
Doesn't expand the Addresses of the Book/Author.
This is still present at this time. Is there any way to fix this?