Example #1
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var exists = await _advertisementService.ExistsAsync(id);

            if (!exists)
            {
                return(NotFound());
            }

            var hasChannels = await _advertisementService.HasChannelsAsync(id);

            if (hasChannels)
            {
                return(BadRequest());
            }

            await _advertisementService.DeleteAsync(id);

            return(Accepted());
        }
Example #2
0
        public async Task <IActionResult> OnPostDeleteAsync(params long[] id)
        {
            await _service.DeleteAsync(id);

            return(JsonData(true));
        }