Add agentbalance
This commit is contained in:
@@ -251,4 +251,17 @@ public class UserService : IUserService
|
||||
{
|
||||
return await _userRepository.GetAllUsersAsync();
|
||||
}
|
||||
|
||||
public async Task<User> GetUserByIdAsync(int userId)
|
||||
{
|
||||
var allUsers = await _userRepository.GetAllUsersAsync();
|
||||
var user = allUsers.FirstOrDefault(u => u.Id == userId);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new Exception($"User with ID {userId} not found");
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user