This commit is contained in:
Userok 2024-10-18 10:04:09 +03:00
parent 0a0aaa36af
commit 80adfe15f5
2 changed files with 7 additions and 2 deletions

View File

@ -42,5 +42,10 @@ namespace Demo.Data.Repository
userLocal.GroupID = userUpdateLocalEnity.GroupID; userLocal.GroupID = userUpdateLocalEnity.GroupID;
return userLocal; return userLocal;
} }
public List<UserLocalEnity> GetAllUsersList()
{
return GetAllUsers;
}
} }
} }

View File

@ -45,7 +45,7 @@ namespace Demo.Domain.UseCase
public User FindUserByGuid(Guid userGuid) 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("Нет такого пользователя"); if (user == null) throw new Exception("Нет такого пользователя");
var group = _repositoryGroupImpl.GetAllGroups().FirstOrDefault(g => g.Id == user.GroupID); var group = _repositoryGroupImpl.GetAllGroups().FirstOrDefault(g => g.Id == user.GroupID);
return new User { FIO = user.FIO, Guid = user.Guid, Group = group }; return new User { FIO = user.FIO, Guid = user.Guid, Group = group };