From e326ed50eab59624e298d4430ead8ac1d508f56f Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Fri, 30 Aug 2024 17:03:57 +0300 Subject: [PATCH] pr review feedback --- src/Microsoft.Graph.Core/Tasks/LargeFileUploadTask.cs | 2 +- .../Tasks/LargeFileUploadTaskTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Graph.Core/Tasks/LargeFileUploadTask.cs b/src/Microsoft.Graph.Core/Tasks/LargeFileUploadTask.cs index d6b66bd4..69a8007b 100644 --- a/src/Microsoft.Graph.Core/Tasks/LargeFileUploadTask.cs +++ b/src/Microsoft.Graph.Core/Tasks/LargeFileUploadTask.cs @@ -75,7 +75,7 @@ internal static IUploadSession ExtractSessionFromParsable(IParsable uploadSessio throw new ArgumentException("The Parsable does not contain the 'uploadUrl' property"); // convert to local type as we don't have the type info for the upload session just that it implements IParsable - var uploadSessionStream = KiotaSerializer.SerializeAsStream(CoreConstants.MimeTypeNames.Application.Json, uploadSession, false);// just in case there's a backing store + using var uploadSessionStream = KiotaSerializer.SerializeAsStream(CoreConstants.MimeTypeNames.Application.Json, uploadSession, false);// just in case there's a backing store var uploadSessionJsonNode = new JsonParseNode(JsonDocument.Parse(uploadSessionStream).RootElement); return uploadSessionJsonNode.GetObjectValue(UploadSession.CreateFromDiscriminatorValue); } diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Test/Tasks/LargeFileUploadTaskTests.cs b/tests/Microsoft.Graph.DotnetCore.Core.Test/Tasks/LargeFileUploadTaskTests.cs index cd6ba0ad..760a0a76 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Test/Tasks/LargeFileUploadTaskTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Core.Test/Tasks/LargeFileUploadTaskTests.cs @@ -27,6 +27,7 @@ public LargeFileUploadTests() { // register the default serialization instance as the generator would. ParseNodeFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.TryAdd(CoreConstants.MimeTypeNames.Application.Json, new JsonParseNodeFactory()); + SerializationWriterFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.TryAdd(CoreConstants.MimeTypeNames.Application.Json, new JsonSerializationWriterFactory()); } [Fact]