From 6b7eb593b15c40fbe081ffe8aef6179aeaf4f5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Habinshuti?= Date: Thu, 12 Sep 2024 08:26:48 +0300 Subject: [PATCH] Fix misleading code sample (#329) --- Odata-docs/odatalib/release-notes/odatalib-8.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Odata-docs/odatalib/release-notes/odatalib-8.md b/Odata-docs/odatalib/release-notes/odatalib-8.md index d20e9e95..2e56b02c 100644 --- a/Odata-docs/odatalib/release-notes/odatalib-8.md +++ b/Odata-docs/odatalib/release-notes/odatalib-8.md @@ -54,7 +54,7 @@ behaviour of `Utf8JsonWriter` which uses `+00:00` like `2022-11-09T09:42:30+00:0 You can change the JSON writer used by `ODataMessageWriter` and by injecting an implementation of `IJsonWriterFactory` to the service provider attached to the `IODataRequestMessage` or `IODataResponseMessage`. The implementation that corresponds to the old default writer is called `ODataJsonWriterFactory`: ```csharp -services.AddService(ODataJsonWriterFactory.Default); +services.AddSingleton(new ODataJsonWriterFactory()); ``` #### Changing `JavaScriptEncoder` @@ -63,7 +63,7 @@ If you want to change which characters are escaped or encoded you can change the and specifying the instance of `JavaScriptEncoder` to be used: ```csharp -services.AddService(new ODataUtf8JsonWriterFactory(JavaScriptEncoder.Default)); +services.AddSingleton(new ODataUtf8JsonWriterFactory(JavaScriptEncoder.Default)); ``` ### Changed `ODataResource.Properties` property type