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

CustomUriLiteralParsers & CustomUriLiteralPrefixes should not be static or irreversible #3158

Open
xuzhg opened this issue Dec 27, 2024 · 0 comments
Assignees

Comments

@xuzhg
Copy link
Member

xuzhg commented Dec 27, 2024

CustomUriLiteralPrefixes is a static class. Registering a prefix with it by calling AddCustomLiteralPrefix is irreversible.

There are problems:

  1. It's not friendship for unit testing
  2. It's a global level object lifecycle in the application itself.
  3. It's not per-model, so multiple models share the only one instance.
  4. Currency issue
  5. No DI support

CustomUriLiteralParsers contains static fields to register the Parsers. Same as CustomUriLiteralPrefixes:

There are problems:

  1. It's not friendship for unit testing
  2. It's a global level object lifecycle in the application itself.
  3. It's not per-model, so multiple models share the only one instance.
  4. Currency issue
  5. No DI support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants