From d6d789e35e74d4843dbb506f5df16759de65fbbd Mon Sep 17 00:00:00 2001 From: "Lauesen.Uffe UFE" Date: Thu, 1 Dec 2022 14:19:05 +0100 Subject: [PATCH] fix: Pass QueryContext to nestedWriteContext #758 --- .../Formatter/Serialization/ODataResourceSerializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataResourceSerializer.cs b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataResourceSerializer.cs index 20e3bfacd..4e2221af7 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataResourceSerializer.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataResourceSerializer.cs @@ -928,7 +928,7 @@ await writer.WriteStartAsync(new ODataResourceSet else { // create the serializer context for the complex and expanded item. - ODataSerializerContext nestedWriteContext = new ODataSerializerContext(resourceContext, edmProperty, null /*resourceContext.SerializerContext.QueryContext*/, selectItem); + ODataSerializerContext nestedWriteContext = new ODataSerializerContext(resourceContext, edmProperty, resourceContext.SerializerContext.QueryContext, selectItem); // write object. IODataEdmTypeSerializer serializer = SerializerProvider.GetEdmTypeSerializer(edmProperty.Type);