public void Update(int commentId, IComment contract) { ParamIs.NotNull(() => contract); _permissionContext.VerifyPermission(PermissionToken.CreateComments); var comment = _ctx.OfType <T>().Load(commentId); _permissionContext.VerifyAccess(comment, EntryPermissionManager.CanEdit); comment.Message = contract.Message; _ctx.Update(comment); _ctx.AuditLogger.AuditLog($"updated comment for {_entryLinkFactory.CreateEntryLink(comment.Entry)}: '{HttpUtility.HtmlEncode(contract.Message)}'"); }