presence/Demo/UI/UserConsole.cs

35 lines
881 B
C#
Raw Normal View History

2024-10-21 12:42:00 +00:00
using Demo.Domain.UseCase;
using Demo.Domain.Models;
using System;
using Demo.Data.Repository;
namespace Demo.UI
{
public class UserConsole
{
private readonly Func<Guid, User> _userUseCase;
private readonly UserRepositoryImpl _userRepository;
private readonly GroupRepositoryImpl _groupRepo;
public UserConsole(Func<Guid, User> userUseCase)
{
_userUseCase = userUseCase;
}
public void DisplayUser(Guid userGuid)
{
try
{
var user = _userRepository.GetByGuid(userGuid); // Уберите лишнюю точку
Console.WriteLine($"GUID: {userGuid}, FIO: {user.FIO}, Group: {user.Group.Name}");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}