using System; using System.Collections.Generic; using System.Diagnostics; using Zurnal.RemaDateBase.DateDao; [DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")] public class PresenceRepositoryIml : IPresenceRepository { private readonly List _presences = new List(); public void AddPresence(PresnceDao presence) { _presences.Add(presence); } public PresnceDao GetPresenceById(int id) { return _presences.Find(p => p.LessonNumber == id); } public IEnumerable GetAllPresences() { return _presences; } public void UpdatePresence(PresnceDao presence) { var existingPresence = GetPresenceById(presence.LessonNumber); if (existingPresence != null) { existingPresence.UserGuid = presence.UserGuid; existingPresence.IsAttendensy = presence.IsAttendensy; existingPresence.Date = presence.Date; existingPresence.userDao = presence.userDao; } } public void DeletePresence(int id) { var presence = GetPresenceById(id); if (presence != null) { _presences.Remove(presence); } } private string GetDebuggerDisplay() { return ToString(); } }