public IActionResult Patch(Guid reviewId, [FromQuery] Guid userId) { Review record; try { record = db.FindDeletedRecordById <Review>(REVIEW_TABLE, reviewId); } catch (Exception e) { Failure failure = FailureFact.Default(e, userId); db.InsertRecordAsync(FAILURE_TABLE, failure); return(StatusCode(500, failure)); } if (record == null) { Failure failure = FailureFact.IdNotFound(null, userId, reviewId); db.InsertRecordAsync(FAILURE_TABLE, failure); return(NotFound(failure)); } else { record.ReInstate(Guid.Empty); db.PutRecord(REVIEW_TABLE, record, reviewId); } Success success = SuccessFact.ReviewReinstated(reviewId, userId); db.InsertRecordAsync(SUCCESS_TABLE, success); return(NoContent()); }