Exemplo n.º 1
0
        public async Task <IActionResult> Delete(string id)
        {
            var _request = new CompanyDeleteRequest(id);
            var _result  = await _mediator.Send(_request);

            return(_result.DeleteRecords > 0 ? (IActionResult)Ok(_result) : NotFound());
        }
Exemplo n.º 2
0
        public virtual IHttpActionResult Delete([FromUri] CompanyDeleteRequest request)
        {
            var result = _companyService.Delete(a => a.Id == request.Id);

            if (result > 0)
            {
                return(Succeed(result, "删除成功"));
            }
            else
            {
                return(Fail("删除失败"));
            }
        }