Fix mediator
This commit is contained in:
@@ -86,6 +86,27 @@ public class PostgreSqlUserRepository : IUserRepository
|
||||
await _context.SaveChangesAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<User>> GetAllUsersAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
await EnsureConnectionOpenAsync();
|
||||
|
||||
var userEntities = await _context.Users
|
||||
.AsNoTracking()
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
|
||||
return userEntities.Select(PostgreSqlMappers.Map);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// If there's an error, try to reset the connection
|
||||
await SafeCloseConnectionAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdateUser(User user)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user