aspnetcorehero / Boilerplate

Clean Architecture Solution Template for ASP.NET Core 5.0. Built with Onion/Hexagonal Architecture and incorporates the most essential Packages your projects will ever need. Includes both WebApi and Web(MVC) Projects.

Home Page:https://codewithmukesh.com/project/aspnet-core-hero-boilerplate/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection Already Exist

webzest opened this issue · comments

Describe the bug
InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first.

To Reproduce
Steps to reproduce the behavior:
Generated a new application with dotnet.
Upgraded to the latest Nuget packages.
Conducted the Migrations to create the new database on my local MSSQL 2019 Server
Tested the Token API Successfully.
Selected the Web as default App and logged in with the default Super Admin User

  1. Go to 'Admin Settings'
  2. Click on 'Users'
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser chrome
  • Version latest

Additional context
Clicking on Roles worked, but the remaining links did not. Same error was generated

I reported same issue in #21 two weeks ago although in my case MS SQL worked, while MySQL and postgresql didn't. Same error, same thing regarding only Roles section working. If you find something out, let me know, as it doesn't look like we'll be getting help here :)

in postgres

Your.Web/Permission/PermissionAuthorizationHandler.cs

var userRoles = _roleManager.Roles.Where(x => userRoleNames.Contains(x.Name));

change to

var userRoles = _roleManager.Roles.Where(x => userRoleNames.Contains(x.Name)).ToList();

This is because do foreach over an EF Core LINQ query isn't supported

Yes, that is the solution. Thank You!

thanks, it's worked for me