Try this in your Generic.php file
<?php
namespace VendorModuleBlockAdminhtmlControllerNameEdit;
use MagentoBackendBlockWidgetContext;
use MagentoCmsApiPageRepositoryInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
/**
* Class Generic
*/
class Generic
{
/**
* @var Context
*/
protected $context;
/**
* @var PageRepositoryInterface
*/
protected $pageRepository;
/**
* @param Context $context
*/
public function __construct(
Context $context,
PageRepositoryInterface $pageRepository
) {
$this->context = $context;
$this->pageRepository = $pageRepository;
}
/**
* Return CMS block ID
*
* @return int|null
*/
/**
* Generate url by route and parameters
*
* @param string $route
* @param array $params
* @return string
*/
public function getUrl($route = '', $params = ())
{
return $this->context->getUrlBuilder()->getUrl($route, $params);
}
}