Exemple #1
0
        public async Task <ActionResult <bool> > BulkDelete([FromBody] List <long> Ids)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CallLogFilter CallLogFilter = new CallLogFilter();

            CallLogFilter = await CallLogService.ToFilter(CallLogFilter);

            CallLogFilter.Id = new IdFilter {
                In = Ids
            };
            CallLogFilter.Selects = CallLogSelect.Id;
            CallLogFilter.Skip    = 0;
            CallLogFilter.Take    = int.MaxValue;

            List <CallLog> CallLogs = await CallLogService.List(CallLogFilter);

            CallLogs = await CallLogService.BulkDelete(CallLogs);

            if (CallLogs.Any(x => !x.IsValidated))
            {
                return(BadRequest(CallLogs.Where(x => !x.IsValidated)));
            }
            return(true);
        }