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

Document how AddScoped works to be per function calls #2173

Open
jsgoupil opened this issue Apr 12, 2019 · 3 comments
Open

Document how AddScoped works to be per function calls #2173

jsgoupil opened this issue Apr 12, 2019 · 3 comments

Comments

@jsgoupil
Copy link

Even though as it seems to have been fixed, no information has been provided regarding how to use AddScoped properly per function calls.

The original bug is here:
#1950

After a full month, we have received no answers, no commits, no documentation explaining how this works.

I am opening this bug as an actionable item for the team to respond properly.

@APIWT
Copy link

APIWT commented Jun 13, 2019

Just a heads up: AddScoped is not fixed as far as I can tell. I still am getting my dependencies behaving like singletons.

@kvbutler
Copy link

kvbutler commented Jul 18, 2019

I can confirm this issue is not fixed in v3.0.6 (of Webjobs.Extensions.Storage BlobTrigger)

Edit: this appears to be working when adding scoped dependencies manually, I am running into an issue with this code always returns the same instance of CustomUserManager

builder.Services
                .AddIdentityCore<CustomUser>()
                .AddEntityFrameworkStores<CustomUserDBContext>()
                .AddUserManager<CustomUserManager>()

Edit 2: Registering like this respects scoping as expected

            builder.Services
                .AddIdentityCore<CustomUser>()
                .AddEntityFrameworkStores<CustomUserDBContext>();
            builder.Services.AddScoped(typeof(CustomUserManager));

@ptjuanramos
Copy link

Still no response.......

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

4 participants