35 lines
881 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|