using Demo.Domain.Models; using Demo.Data.LocalData; namespace Demo.Data.Repository { public class GroupRepositoryImpl { // public List GetAllGroups() => LocalStaticData.groups; public GroupRepositoryImpl() { GetAllGroups = LocalStaticData.groups; } public List GetAllGroups { get; set; } public void CreateNewGroup(GroupLocalEntity groupLocalEntity) { GetAllGroups.Add(groupLocalEntity); } public GroupLocalEntity? UpdateGroup(GroupLocalEntity groupUpdateLocalEntity) { int index = GetAllGroups.FindIndex(x => x.ID == groupUpdateLocalEntity.ID); if (index == -1) return null; GetAllGroups[index].Name = groupUpdateLocalEntity.Name; Console.WriteLine($"Обновленный Name: {GetAllGroups[index].Name}"); return GetAllGroups[index]; } } }