Add agentbalance

This commit is contained in:
2025-08-15 19:35:01 +07:00
parent f58d1cea3b
commit cd93dede4e
11 changed files with 100 additions and 18 deletions

View File

@@ -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;
}
}