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

Passing Information Between Controllers #35

Open
davidbuckleyni opened this issue Jul 13, 2020 · 1 comment
Open

Passing Information Between Controllers #35

davidbuckleyni opened this issue Jul 13, 2020 · 1 comment

Comments

@davidbuckleyni
Copy link

Hi i stumbled uppon your localstorage looks a great solution I just need to pass a cased Id from one controller to another was trying to use session in asp.net core but it was loosing the value.

How do I use localstorage between controllers without deleting the previous instance data is it easy to do.

@hanssens
Copy link
Owner

hanssens commented Feb 18, 2021

Stating the obvious, but please be aware that the lib is not built for multi-concurrency or distributed scenarios. That being said, the limitation of using localstorage between controllers is that you use it read-only + re-use the same filename (and use Persist() to store it to disk).

One option to accomplish would be to register LocalStorage as a singleton. Alternatively, if you reuse the same file between controllers. That is, as long as you're using it only to read between different operations. Write, as in concurrent writes, is not supported.

In the latest v2.1.0 release I've started working on the 'read-only' mode. This is still a work in progress, but theoretically if you have an existing localstorage file that you use as 'read-only' this might solve your problem.

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

No branches or pull requests

2 participants