using data.Exception; using data.RemoteData.RemoteDataBase.DAO; using domain.Models; using User = data.RemoteData.RemoteDataBase.DAO.UserDao; namespace data.Repository { public class UserRepositoryImpl : IUserRepository { private List _users; public IEnumerable GetAllUsers => throw new NotImplementedException(); public UserRepositoryImpl() { _users = new List(); } public bool RemoveUserByGuid(Guid userGuid) { var user = _users.FirstOrDefault(u => u.Guid == userGuid); if (user == null) throw new UserNotFoundException(userGuid); _users.Remove(user); return true; } public User? UpdateUser(User user) { var existingUser = _users.FirstOrDefault(u => u.Guid == user.Guid); if (existingUser == null) throw new UserNotFoundException(user.Guid); existingUser.FIO = user.FIO; existingUser.GroupID = user.GroupID; return existingUser; } public List GetUserNames() { return _users .Select(u => new User { Guid = u.Guid, FIO = u.FIO }) .ToList(); } List IUserRepository.GetUserNames() { throw new NotImplementedException(); } } }