From 80adfe15f5e2bb2e5dd4bc5dc81e4ccb6de6053f Mon Sep 17 00:00:00 2001 From: Userok Date: Fri, 18 Oct 2024 10:04:09 +0300 Subject: [PATCH] Pravki --- Demo/Data/Repository/UserRepositoryImpl.cs | 7 ++++++- Demo/Domain/UseCase/UserUseCase.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Demo/Data/Repository/UserRepositoryImpl.cs b/Demo/Data/Repository/UserRepositoryImpl.cs index 2a05b9f..2e233fb 100644 --- a/Demo/Data/Repository/UserRepositoryImpl.cs +++ b/Demo/Data/Repository/UserRepositoryImpl.cs @@ -42,5 +42,10 @@ namespace Demo.Data.Repository userLocal.GroupID = userUpdateLocalEnity.GroupID; return userLocal; } + public List GetAllUsersList() + { + return GetAllUsers; + } } -} + +} \ No newline at end of file diff --git a/Demo/Domain/UseCase/UserUseCase.cs b/Demo/Domain/UseCase/UserUseCase.cs index 93a4ae4..18073ff 100644 --- a/Demo/Domain/UseCase/UserUseCase.cs +++ b/Demo/Domain/UseCase/UserUseCase.cs @@ -45,7 +45,7 @@ namespace Demo.Domain.UseCase public User FindUserByGuid(Guid userGuid) { - var user = _repositoryUserImpl.GetAllUsers().FirstOrDefault(u => u.Guid == userGuid); + var user = _repositoryUserImpl.GetAllUsersList().FirstOrDefault(u => u.Guid == userGuid); if (user == null) throw new Exception("Нет такого пользователя"); var group = _repositoryGroupImpl.GetAllGroups().FirstOrDefault(g => g.Id == user.GroupID); return new User { FIO = user.FIO, Guid = user.Guid, Group = group };