presence/Demo/UI/UserConsole.cs
Class_Student 85738972fe init
2024-10-21 15:42:00 +03:00

35 lines
881 B
C#

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