using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Demo.Domain.Models; namespace Demo.Domain.UseCase { public class GroupUseCase { private List _groups = new List(); private int _nextId; public IEnumerable GetAllGroups() => _groups; public void AddGroup(string name) { _groups.Add(new Group { Id = _nextId++, Name = name }); } public void UpdateGroupName(Guid id, string newName, bool Id) { var group = _groups.FirstOrDefault(g => Id); if (group != null) group.Name = newName; } } }