0
shobhit created
- ABP Framework version: v4.2.2
- UI Type: Angular
- Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) SQL Server
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
How i can create Bulk user and user record should be commited in DB without waiting for transaction to complete.
1 Answer(s)
-
0
Hi,
You can create users using a separate transaction. for example:
foreach(var item in list) { using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional:true)) { try { var user = new IdentityUser( GuidGenerator.Create(), <username>, /// item.Username <email>, // item.email CurrentTenant.Id ); user.SetPhoneNumber(<phoneNumber>, false); await UserManager.CreateAsync(user, <password>)).CheckErrors(); await uow.CompleteAsync(); } catch (Exception e) { await uow.RollbackAsync(); throw e; } } }