コード例 #1
0
        public async Task <bool> Delete(int id)
        {
            if (!ModelState.IsValid)
            {
                throw new Exception("400:Badrequest");
            }

            if (!_newsCategoryService.ExistsByAdmin(id))
            {
                throw new Exception("404:NotFound Data");
            }

            await _newsCategoryService.DeleteAsync(id);

            return(true);
        }