$expand functionality is not supporting in EF Core
OData Expand is throwing error while trying to filter the child entitities.
For example, I just followed the below example. But $expand functionality is not supporting and throwing error. Please assist. Referred the below URL's to fix the expand functionality. But it didn't work.
https://wellsb.com/csharp/aspnet/odata-api-ef-core-blazor/ https://devblogs.microsoft.com/odata/enabling-endpoint-routing-in-odata/ https://devblogs.microsoft.com/odata/experimenting-with-odata-in-asp-net-core-3-1/
Example Request URL : http://localhost:55145/odata/weatherforecast?$expand&=WeatherForecast
Technical details EF Core version: 3.1.4 Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) Target framework: (e.g. .NET Core 3.1) Operating system: IDE: (e.g. Visual Studio 2019 16.3)
Can you try the without the '&' right after the $expand. So the query would be $expand=WeatherForecast.
Previously i have mentioned URL wrongly. Please check the below one. The exact URL is : http://localhost:55145/odata/weatherforecast?$expand=customer($filter=Name eq 'Test')
Entity structure: public class WeatherForecast { public Guid Id { get; set; } public DateTime Date { get; set; } public int TemperatureC { get; set; } public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); public string Summary { get; set; } public Customer Customer { get; set; } }
public class Customer
{
public Guid Id { get; set; }
public string Name { get; set; }
}
@AnvardeenBatcha can you share a reproduction of the issue and the exact error message that you are getting.
@AnvardeenBatcha Was this issue resolved?
Closing this issue due to inactivity. If this issue still persists, feel free to create a new issue.
Closing this issue due to inactivity. If this issue still persists, feel free to create a new issue.