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

Incorrect service lifetime #37

Open
Andrzej-W opened this issue Feb 16, 2019 · 4 comments
Open

Incorrect service lifetime #37

Andrzej-W opened this issue Feb 16, 2019 · 4 comments

Comments

@Andrzej-W
Copy link

Andrzej-W commented Feb 16, 2019

This sample will probably be ported to Razor Components in the near future. You should change service lifetime to scoped. Otherwise state will be shared between all users which is not what you want.

@marcominerva
Copy link

Keep in mind that the Razor application is executed inside the client browser, so every user will have his own singleton object (i.e., it acts like a client application).

@Andrzej-W
Copy link
Author

@marcominerva My first sentence was:

This sample will probably be ported to Razor Components in the near future.

Current name for Razor Components is Blazor Server Side. In this model application is executed on the server. On the client singleton and scoped works the same. If you want to have an application that works correctly in server and client mode you should use scoped for services which have to be unique for each user.

@marcominerva
Copy link

Ok, got it. In your first comment you quoted a FlightFinder.Client project file, so I thought you were referring only to the client side.

@Eilon
Copy link
Member

Eilon commented May 29, 2019

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

3 participants