Cleanup
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#nullable enable
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -39,8 +41,11 @@ namespace UserService.DatabaseLayer.Repositories
|
||||
|
||||
public override async Task<bool> UpdateAsync(SecurityGroup entity, CancellationToken token = default)
|
||||
{
|
||||
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
||||
|
||||
await using var db = new UserServiceDbContext();
|
||||
Context(db).Update(entity);
|
||||
db.UserMembers.UpdateRange(entity.Members);
|
||||
var items = await db.SaveChangesAsync(token).ConfigureAwait(false);
|
||||
return items > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user