示例#1
0
        public async Task <IActionResult> Delete(string Id)
        {
            try
            {
                int rows = await _service.DeleteByKey(Id);//得到影响行数

                if (rows > 0)
                {
                    return(NoContentAction());
                }

                return(NotFoundAction(false, "删除失败!原因:影响行数为0"));
            }
            catch (Exception ex)
            {
                return(OKAction(false, $"删除失败!原因:{ex.Message}"));
            }
        }