Open Closed

Query Related to Bulk User Insert #7048


User avatar
0
Exceego created
  • ABP Framework version: v7.3.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) / MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Our requirement is to insert bulk users. We are using IdentityRepository InsertManyAsync to insert bulk users, it is working good except create password for the users because, we can not assign PasswordHash to IdentityUser entity as it's set parameter is protected and we don't want to use UserManager to create users.

Is there any alternate way to insert bulk users Please advise.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can inject the IPasswordHasher<IdentityUser> service. Then use ObjectHelper to set the protected property.

    ObjectHelper.TrySetProperty(identityUser, x => x.PasswordHash, () => your_password);

    https://github.com/dotnet/aspnetcore/blob/main/src/Identity/Extensions.Core/src/IPasswordHasher.cs

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 09, 2026, 11:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.