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

Multiple queries were made to the database to authorize the user #986

Open
mrmoein opened this issue Sep 4, 2023 · 3 comments
Open

Multiple queries were made to the database to authorize the user #986

mrmoein opened this issue Sep 4, 2023 · 3 comments

Comments

@mrmoein
Copy link

mrmoein commented Sep 4, 2023

Describe the bug
Multiple queries were made to the database to authorize the user.

To Reproduce
Steps to reproduce the behavior:

  1. Add multiple role.
  2. Add this attribut to handler.
    [Authorize(Roles = "Administrator2,Administrator3,Administrator4,Administrator2,Administrator3,Administrator4,Administrator2,Administrator3,Administrator4,Administrator2,Administrator3,Administrator4")]
  3. Request with user that have role Administrator.

I replace sql database with mysql database.
I add miniProfiler to the project and check the generated queries.
For each role, it creates a database query.

Expected behavior
Make a maximum of 2 connections.

Screenshots
screencapture-localhost-5000-profiler-results-2023-09-04-21_58_39

@NurulloSulaymonov
Copy link

Hello I know it is irellevent. How did you generate this kind of call stack?

@mrmoein
Copy link
Author

mrmoein commented Sep 5, 2023

Hello I know it is irellevent. How did you generate this kind of call stack?

Do you mean the picture? With the ‍‍‍‍‍MiniProfiler.EntityFrameworkCore package

@nighttiger1990
Copy link
Contributor

I think this relate

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