You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using AspNetCore.OData 8.2.5 and .net6 Api
Have a dbcontext entity as Product, On top of Product i have a json converter which is not working as expected like
From Product entity response i want to concate the properties
`[JsonConverter(typeof(ProductDataConverter))]
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public List<DataRow> Data { get; set; }
public string Schema { get; set; }
}
public class DataRow
{
public int Id { get; set; }
public int ProductId { get; set; }
public string Data { get; set; }
}`
my api will be
`public async Task Get(string dataSourceName, ODataQueryOptions options)
{
private IQueryable ApplyODataQuery(string dataSourceName, ODataQueryOptions options)
{
IQueryable dataSource = _productDataService.GetDataSourceByQuery(dataSourceName).IgnoreAutoIncludes();
var result = options.ApplyTo(dataSource);
return result.Cast();
}`
When i execute this code then i am getting the below exception
"Error": {
"Code": 500,
"Message": "Token PropertyName in state Property would result in an invalid JSON object. Path 'Container.Value[0].Instance'."
}
Any help would be appreciate, i tried many ways but nothing is working out, Once we execute the db query if i see the result it showing as AspNetCore.SelectAllExpand with out converter i am able to get the data as expected but if i register that converter then it's not working
Assemblies affected
Which assemblies and versions are known to be affected e.g. ASP.NET Core OData 8.x
Describe the bug
A clear and concise description of what the bug is.
Reproduce steps
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Data Model
Please share your Data model, for example, your C# class.
EDM (CSDL) Model
Please share your Edm model, for example, CSDL file.
You can send
$metadata
to get a CSDL XML content.Request/Response
Please share your request Uri, head or the request body
Please share your response head, body.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Please share your call stack or any error message
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: