mirror of
https://github.com/bitwarden/server.git
synced 2025-05-09 05:32:24 -05:00
Switch to LinqToDB for significant perf improvement
This commit is contained in:
parent
360aef2521
commit
db04c2c0e6
@ -2,6 +2,7 @@
|
|||||||
using Bit.Seeder.Factories;
|
using Bit.Seeder.Factories;
|
||||||
using Bit.Seeder.Settings;
|
using Bit.Seeder.Settings;
|
||||||
using Bit.SharedWeb.Utilities;
|
using Bit.SharedWeb.Utilities;
|
||||||
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@ -42,10 +43,12 @@ public class GenerateCommand
|
|||||||
db.Add(organization);
|
db.Add(organization);
|
||||||
db.Add(user);
|
db.Add(user);
|
||||||
db.Add(orgUser);
|
db.Add(orgUser);
|
||||||
db.AddRange(additionalUsers);
|
|
||||||
db.AddRange(additionalOrgUsers);
|
|
||||||
|
|
||||||
db.SaveChanges();
|
db.SaveChanges();
|
||||||
|
|
||||||
|
// Use LinqToDB's BulkCopy for significant better performance
|
||||||
|
db.BulkCopy(additionalUsers);
|
||||||
|
db.BulkCopy(additionalOrgUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user