Esempio n. 1
0
        public IActionResult Delete(string id)
        {
            var recommend = _iRecommendService.GetById(id);
            var count     = 1;

            if (recommend == null)
            {
                throw new Exception("该推荐不存在");
            }
            try
            {
                // save
                _iRecommendService.Delete(id);
                return(Output(new DeleteOrUpdateResponse
                {
                    id = id
                }, count));
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }