using Demo.domain.Models; namespace Demo.Data.Repository { public class PresenceRepositoryImpl : IPresenceRepository { public List GetAllPresences = new List(); public List GetPresences() { return GetAllPresences; } public List GetPresencesByGroup() { return GetAllPresences; } public List GetPresencesByGroupAndDate() { return GetAllPresences; } public List SavePresence(List presenceLocalEntities){ GetAllPresences.AddRange(presenceLocalEntities); return presenceLocalEntities; } public void UpdateAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){ foreach(PresenceLocalEntity presence in GetAllPresences.Where(x => x.LessonNumber >= firstLesson && x.LessonNumber <= lastLesson && x.Date == date)){ if (presence.UserGuid == UserGuid){ presence.IsAttedance = false; } } } } }