using Demo.Data.Repository; using Demo.Domain.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class UserUseCase { private List _users = new List(); private UserRepositoryImpl userRepositoryImpl; private GroupRepositoryImpl groupRepositoryImpl; public UserUseCase(UserRepositoryImpl userRepositoryImpl, GroupRepositoryImpl groupRepositoryImpl) { this.userRepositoryImpl = userRepositoryImpl; this.groupRepositoryImpl = groupRepositoryImpl; } public IEnumerable GetAllUsers() => _users; public User FindUserByGuid(Guid id) => _users.FirstOrDefault(u => u. Guid == id); public void DeleteUserByGuid(Guid id) { var user = _users.FirstOrDefault(u => u.Guid == id); if (user != null) _users.Remove(user); } public void UpdateUserByGuid(Guid id, string newName) { var user = _users.FirstOrDefault(u => u.Guid == id); if (user != null) user.FIO = newName; } internal bool RemoveUserByGuid(Guid guidUser) { throw new NotImplementedException(); } }