Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update DI settings #1344

Merged
merged 1 commit into from
Nov 13, 2024
Merged

update DI settings #1344

merged 1 commit into from
Nov 13, 2024

Conversation

marabooy
Copy link
Member

@marabooy marabooy commented Nov 12, 2024

Message reader and Writer have the wrong scope in the DI container.
This could cause some issues whenever users retrieve and write to them in the scope of a request.

Fixes #1337 by updating the dependencies to 8.0.2 as well as moving reader and writer settings to scoped.
This includes OData/odata.net#3058

@marabooy marabooy requested review from habbes, xuzhg, WanjohiSammy, gathogojr and DButoyez and removed request for habbes November 12, 2024 14:54
@@ -38,7 +38,7 @@ public static IServiceCollection AddDefaultWebApiServices(this IServiceCollectio
// ReaderSettings and WriterSettings are registered as prototype services.
// There will be a copy (if it is accessed) of each prototype for each request.
#pragma warning disable CS0618 // ReadUntypedAsString is obsolete in ODL 8.
services.AddSingleton(new ODataMessageReaderSettings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we had AddSingleton in the first place. Also check whether the comments above are still relevant, we no longer use "prototypes".

@marabooy marabooy changed the title update di settings update DI settings Nov 12, 2024
@marabooy marabooy merged commit 9a0c7db into main Nov 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ODataMessageWriterSettings are registered as Singleton in DI but has ODataUri that are scoped to the request
3 participants