LocalContext/ClientContext #3938
Answered
by
rockfordlhotka
ajohnstone-ks
asked this question in
Questions
-
I'm migrating to Csla 7 and I'm not sure my understanding of LocalContext/ClientContext is correct anymore. Is it safe to store things there so they are accessible on the client? If I put something in LocalContext is it available to all future data portal calls? How does async and threads affect things? |
Beta Was this translation helpful? Give feedback.
Answered by
rockfordlhotka
May 15, 2024
Replies: 1 comment 2 replies
-
Local/Client context should be valid in CSLA 7 - as long as you aren't using Blazor 8. The data portal flows ClientContext from client to server. LocalContext is local to a specific device and doesn't flow through the data portal. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you actually create threads (like Task.Run), it is up to you to flow any context to the new thread.
Normal async/await constructs don't actually create threads, so generally no extra work is required. But Task.Run (or shudder
new Thread
are a whole other matter).