forked from ddrilling/AsbCloudServer
bug fixing in UserRepositoty.UpdateAsync
This commit is contained in:
parent
00a6a333e4
commit
b70fa35ef6
@ -101,13 +101,14 @@ namespace AsbCloudInfrastructure.Repository
|
||||
|
||||
var userRoles = await userRoleRepository.GetByNamesAsync(dto.RoleNames, token).ConfigureAwait(false);
|
||||
await UpdateRolesCacheForUserAsync(dto.Id, userRoles, token);
|
||||
|
||||
var entity = Convert(dto);
|
||||
|
||||
var result = dbContext.Users.Upsert(entity);
|
||||
var userInDb = dbContext.Users.FirstOrDefault(u => u.Id == dto.Id);
|
||||
if (userInDb is not null)
|
||||
{
|
||||
userInDb = Convert(dto);
|
||||
await dbContext.SaveChangesAsync(token);
|
||||
}
|
||||
DropCacheUsers();
|
||||
return result.Entity.Id;
|
||||
return userInDb!.Id;
|
||||
}
|
||||
|
||||
public async Task<int> DeleteAsync(int id, CancellationToken token)
|
||||
|
Loading…
Reference in New Issue
Block a user