Пример #1
0
        public async Task <ActionResult <List <MonsterResponse> > > GetDeadMonsterListAsync(
            [FromServices] NaheulbookExecutionContext executionContext,
            [FromRoute] int groupId,
            [FromQuery] int startIndex,
            [FromQuery] int count
            )
        {
            try
            {
                var monsters = await _monsterService.GetDeadMonstersForGroupAsync(executionContext, groupId, startIndex, count);

                return(_mapper.Map <List <MonsterResponse> >(monsters));
            }
            catch (ForbiddenAccessException ex)
            {
                throw new HttpErrorException(StatusCodes.Status403Forbidden, ex);
            }
            catch (GroupNotFoundException ex)
            {
                throw new HttpErrorException(StatusCodes.Status404NotFound, ex);
            }
        }