mirror of
https://github.com/bitwarden/server.git
synced 2025-07-17 23:50:58 -05:00
[PM-336] Nullable Platform & Unowned Services (#5646)
* Nullable Platform & Unowned Services * Fix build errors * Format
This commit is contained in:
@ -513,15 +513,21 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ReplaceAsync(Core.Entities.Collection collection, IEnumerable<CollectionAccessSelection> groups,
|
||||
IEnumerable<CollectionAccessSelection> users)
|
||||
public async Task ReplaceAsync(Core.Entities.Collection collection, IEnumerable<CollectionAccessSelection>? groups,
|
||||
IEnumerable<CollectionAccessSelection>? users)
|
||||
{
|
||||
await UpsertAsync(collection);
|
||||
using (var scope = ServiceScopeFactory.CreateScope())
|
||||
{
|
||||
var dbContext = GetDatabaseContext(scope);
|
||||
await ReplaceCollectionGroupsAsync(dbContext, collection, groups);
|
||||
await ReplaceCollectionUsersAsync(dbContext, collection, users);
|
||||
if (groups != null)
|
||||
{
|
||||
await ReplaceCollectionGroupsAsync(dbContext, collection, groups);
|
||||
}
|
||||
if (users != null)
|
||||
{
|
||||
await ReplaceCollectionUsersAsync(dbContext, collection, users);
|
||||
}
|
||||
await dbContext.UserBumpAccountRevisionDateByCollectionIdAsync(collection.Id, collection.OrganizationId);
|
||||
await dbContext.SaveChangesAsync();
|
||||
}
|
||||
|
Reference in New Issue
Block a user