예제 #1
0
        public async Task <BasexResponse <ICollection <AnnouncementResponse> > > GetAllAsync(int givenClassroomId)
        {
            try
            {
                var announcements = await _announcementDal.FindAllAsync(a => a.Material.GivenClassroomId == givenClassroomId);

                var response = _mapper.Map <ICollection <Announcement>, ICollection <AnnouncementResponse> >(announcements);
                return(new BasexResponse <ICollection <AnnouncementResponse> >(response));
            }
            catch (Exception ex)
            {
                return(new BasexResponse <ICollection <AnnouncementResponse> >(ex.Message));
            }
        }