AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

Expose ability to over-control complex property serialization

Open xuzhg opened this issue 3 years ago • 3 comments

Assemblies affected Which assemblies and versions are known to be affected e.g. ASP.NET Core OData 8.x

Describe the bug Recently, We have had customers who want to omit the null complex property.

So far, we don't have a better for them to omit null complex property. As a workaround, they have to override the "CreateSelectExpandNode" virtual method to change the "SelectExpandNode" returns from this method.

This is ugly because "SelectExpandNode" is an "entity scope" object used to control all entities' serialization for the same type.

So, we'd like to have a better "overridable" method for customers to use to control the serialization of the complex.

xuzhg avatar Aug 09 '22 15:08 xuzhg

We need to make sure that the client can handle these responses before supporting this on the service side.

corranrogue9 avatar Aug 09 '22 16:08 corranrogue9

see #657

chrisspre avatar Aug 09 '22 16:08 chrisspre

Can we make sure to also create the other issues where needed?

corranrogue9 avatar Aug 09 '22 16:08 corranrogue9

created a separate issue for omit-values prefer header at server side, see details at: https://github.com/OData/AspNetCoreOData/issues/672

xuzhg avatar Aug 24 '22 16:08 xuzhg