public IActionResult CreateAttendance(DungeonAttendanceViewModel dungeonAttendanceViewModel)
        {
            DungeonAttendance _newAttendance = Mapper.Map <DungeonAttendanceViewModel, DungeonAttendance>(dungeonAttendanceViewModel);

            _dungeonAttendanceRepository.Add(_newAttendance);
            _dungeonAttendanceRepository.Commit();

            dungeonAttendanceViewModel = Mapper.Map <DungeonAttendance, DungeonAttendanceViewModel>(_newAttendance);

            CreatedAtRouteResult result = CreatedAtRoute("GetAttendance", new { controller = "Attendance", id = dungeonAttendanceViewModel.Id }, dungeonAttendanceViewModel);

            return(result);
        }
        public IActionResult DeleteAttendance(DungeonAttendanceViewModel dungeonAttendanceViewModel)
        {
            var _attendanceDb = _dungeonAttendanceRepository.GetSingle(dungeonAttendanceViewModel.Id);

            if (_attendanceDb == null)
            {
                return(new NotFoundResult());
            }
            else
            {
                _dungeonAttendanceRepository.Delete(_attendanceDb);
                _dungeonAttendanceRepository.Commit();
            }

            return(new NoContentResult());
        }
        public IActionResult UpdateAttendance([FromBody] DungeonAttendanceViewModel dungeonAttendanceViewModel)
        {
            var _attendanceDb = _dungeonAttendanceRepository.GetSingle(dungeonAttendanceViewModel.Id);

            if (_attendanceDb == null)
            {
                return(NotFound());
            }
            else
            {
                _attendanceDb.FireDragonHardMode   = dungeonAttendanceViewModel.FireDragonHardMode;
                _attendanceDb.IceDragonHardMode    = dungeonAttendanceViewModel.IceDragonHardMode;
                _attendanceDb.PoisonDragonHardMode = dungeonAttendanceViewModel.PoisonDragonHardMode;
                _attendanceDb.BlackDragonHardMode  = dungeonAttendanceViewModel.BlackDragonHardMode;

                _playerRepository.Commit();
            }

            dungeonAttendanceViewModel = Mapper.Map <DungeonAttendance, DungeonAttendanceViewModel>(_attendanceDb);

            return(new OkObjectResult(dungeonAttendanceViewModel));
        }