Open UmairB opened 4 years ago
@UmairB Did you try the previous version? I'd like to see whether it's a regression or not?
@UmairB Did you try the previous version? I'd like to see whether it's a regression or not?
Yep problem repoduces on version 7.4.1 of package
@xuzhg Still reproducible, any plans for this? Seems like not a big deal right 😅?
This seems to have been fixed in ASP.NET Core OData 8.2.0 and ASP.NET Web API OData 7.7.0. See https://github.com/OData/AspNetCoreOData/issues/434
I've confirmed this is fixed in Microsoft.AspNetCore.OData 7.7.1.
Remember to add the key "Prefer" with value "return=representation" to the request header.
When posting to create a new entity, and returning CreateODataResult, $select/$expand options via EnableQuery in the query string are ignored and not applied. The issue does not happen and query options are successfully applied if instead the standard Microsoft.AspNetCore.Mvc.CreatedResult is returned.
Assemblies affected
Microsoft.AspNetCore.OData 7.5.0 Microsoft.AspNetCore.OData 7.4.1
Reproduce steps
Create any simple odata model with atleast one entity with a primary key. E.g.
and create the following mvc action
The following request
returns the full entity, rather than only the
id
property.The following works as expected
and only the id property is returned.
Expected result
Query options should be applied and only the selected and/or expanded properties should be returned.
Actual result
Query options are ignored and the full entity is returned.