public void Delete([FromBody] AlarmIdListApiModel alarmList)
        {
            if (alarmList.Items == null || !alarmList.Items.Any())
            {
                throw new InvalidInputException("Must give list of at least 1 id to delete");
            }

            if (alarmList.Items.Count > DELETE_LIMIT)
            {
                throw new InvalidInputException("Cannot delete more than 1000 alarms");
            }

            this.alarmService.Delete(alarmList.Items);
        }
Exemplo n.º 2
0
        public async Task DeleteAsync([FromBody] AlarmIdListApiModel alarmList)
        {
            if (alarmList.Items == null || !alarmList.Items.Any())
            {
                throw new InvalidInputException("Must give list of at least 1 id to delete");
            }

            if (alarmList.Items.Count > DeleteLimit)
            {
                throw new InvalidInputException("Cannot delete more than 1000 alarms");
            }

            await this.alarmService.Delete(alarmList.Items);
        }