Replies: 2 comments 3 replies
-
plugins are statically added. They sensible defaults that can be overriden in a moduleinit. but you can override any of a specific plugins settings using either a VerifySettings instance or the fluent API. If your want to use DI then you can do that with instances of VerifySettings. here are some some scenarios that may work for you
or this
or this
|
Beta Was this translation helpful? Give feedback.
-
also note that "plugin maintainers" is me for all but 2 of the plugins |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell, Verify only provides a static api for doing the actual verifications.
But what I'm looking for is something that's DI friendly, so I can
[ModuleInitializer]
which makes it difficult to make utility libraries that contain wrappers around the verification logic to specify verify with specific settings/pluginsEssentially something like
In this example,
Verifier
is still static api, but to me it would be even nicer if it was also non-static (maybe with a static singleton likeRandom
has, for easy access) because that would allow me to write extension methods.I realize this project has 28 major versions (thanks for the hard work!!), so I imagine that this is maybe a design decision.
To me there is no reason that a non-static api could not co-exist with the static one if there's a shared singleton that the static methods just forward the calls to.
Although it would of course require a bunch of work, also for plugin maintainers.
I'm curious as to why the current design is as it is (maybe I missed some obvious reason why the current one is actually ideal?), and if there's any chance of it changing in the future?
Beta Was this translation helpful? Give feedback.
All reactions