shared state that's accessible for the webserver? #115
Answered
by
jchristn
Zerowalker
asked this question in
Q&A
-
How do you make a shared state that's accessible within a route? Currently i just make it static and global, but i would rather have it embedded in the context or something. Thanks:) |
Beta Was this translation helpful? Give feedback.
Answered by
jchristn
Jul 3, 2023
Replies: 1 comment 1 reply
-
Hi, there are a couple of immediate options.
Cheers, Joel |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Zerowalker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, there are a couple of immediate options.
add a pre-request handler that will attach your state to the
HttpContext.Metadata (object)
property.use a static class that is
public
/internal
that the assembly/routes can reach.Cheers, Joel