public async Task <JsonResult> MyUpdate(TenantDto input) { try { input.IsActive = true; await _tenantAppService.Update(input); return(Json(new { result = "success", content = "记录修改成功" })); } catch (Exception ex) { throw new UserFriendlyException("表操作失败", ex.Message); } }
public async Task <IActionResult> Put(TenantDto tenantDto) { try { TenantDto updatedTenant = await _tenantAppService.Update(tenantDto); if (updatedTenant == null) { return(NotFound("Tenant not found.")); } return(Ok(updatedTenant)); } catch (Exception ex) { return(Conflict("Error updating the Tenant. " + ex.Message)); } }
//[AbpAuthorize(PermissionNames.Pages_Users)] //[DontWrapResult] //不需要AbpJsonResult public async Task <JsonResult> Update([FromBody] TenantDto input) { var output = await _tenantAppService.Update(input); return(Json(output)); }