using Demo.Data.LocalData; using Demo.Domain.Models; namespace Demo.Data.Repository { public class PresenceRepositoryImpl : IPresenceRepository { public List GetAllPresence = new List{}; public List GetAllPresences(){ return GetAllPresence; } public List GetPresenceByGroup(){ return GetAllPresence; } public List GetPresenceByGroupDate(){ return GetAllPresence; } public List GeneratePresence(List presenceLocalEntities){ GetAllPresence.AddRange(presenceLocalEntities); return presenceLocalEntities; } public List GeneratePresenceWeek(List presenceLocalEntities){ GetAllPresence.AddRange(presenceLocalEntities); return presenceLocalEntities; } public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){ foreach(PresenceLocalEntity presence in GetAllPresence.Where(x => x.LessonNumber >= firstLesson && x.LessonNumber <= lastLesson && x.Date == date)){ if (presence.UserGuid == UserGuid){ presence.IsAttedance = false; } } } } }