Exemplo n.º 1
0
        public async Task <IActionResult> PostStudentLectureAttendance(SaveStudentAttendanceResource[] resources)
        {
            var attendances = _mapper.Map <IEnumerable <SaveStudentAttendanceResource>, IEnumerable <StudentAttendance> >(resources);
            var result      = await _lectureService.AddStudentAttendance(attendances);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var studentResource = _mapper.Map <IEnumerable <StudentAttendance>, IEnumerable <StudentAttendanceResource> >(result.StudentAttendance);

            return(Ok(studentResource));
        }