efcore icon indicating copy to clipboard operation
efcore copied to clipboard

I am facing issue With Removing User From Role As well as

Open ravipatel3482 opened this issue 6 years ago • 5 comments

 var roles = await userManager.GetRolesAsync(user);            
  var result = await userManager.RemoveFromRolesAsync(user, roles);

this Throws Exception Like An exception occurred while iterating over the results of a query for context type 'LogicLevel.AppDbContext'.

Also At

 userManager.AddToRoleAsync(user, role. Name)
``
same kind exception also happen over here An exception occurred while iterating over the results of a query for context type 'LogicLevel.AppDbContext
Microsoft.EntityFrameworkCore.Query: Error: 
EF Core version:6
Database provider:  Microsoft.EntityFrameworkCore.SqlServer
Target framework: (e.g. .NET 5.0)
Operating system: windows
IDE: Visual Studio 2019 16.3

ravipatel3482 avatar Nov 25 '20 14:11 ravipatel3482

This issue is lacking enough information for us to effectively reproduce. Please post a runnable project/solution or complete code listing that demonstrates the behavior you are seeing.

smitpatel avatar Nov 25 '20 17:11 smitpatel

http://justonlybusiness.com/ is the URL https://github.com/Raviniki/businesspoint.git where you can find all code for sample project register one user as admin and then try to go to admin activity and then after under admin activity manage role --> Add or Remove User -->then Select User -->Update Not Work As Well As All User-->Edit User -->Manage Role Also Not Work What is fix for that

ravipatel3482 avatar Nov 25 '20 18:11 ravipatel3482

i have provided the full code and every thing please clone the code and run locally

On Wed, Nov 25, 2020 at 12:24 PM Smit Patel [email protected] wrote:

This issue is lacking enough information for us to effectively reproduce. Please post a runnable project/solution or complete code listing that demonstrates the behavior you are seeing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dotnet/efcore/issues/23474#issuecomment-733843704, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJFU5WC2NAOFHZDSETOFVTSRU4TXANCNFSM4UCPLM7Q .

ravipatel3482 avatar Nov 25 '20 18:11 ravipatel3482

i think i am good i found error like my identity user which i am saving using Sp don't have security stamp and concurrancystamp that why i am getting that error now i am closing that issue sorry for bothering Patel

ravipatel3482 avatar Nov 26 '20 14:11 ravipatel3482

solved

ravipatel3482 avatar Nov 26 '20 14:11 ravipatel3482