public Object IsAttendanceMarked(int CouId, string Date) { AttendanceDTO stuAtt = AttendanceDAO.GetAttendancesByCouId(CouId).First(); List <AttendanceHistoryDTO> attHisList = AttendanceHistoryDAL.GetAttendanceHistorysByAttId(stuAtt.AttId); bool toReturn = false; foreach (AttendanceHistoryDTO ah in attHisList) { if (ah.HisDateTime == Date) { toReturn = true; } } var IsMarked = new { IsSaved = toReturn }; return(IsMarked); }