public function convertUpsertDtoToEntity(TemplateEntityDto $dto): TemplateEntityInterface
    {
        if ($this->unitOfWorkHelper->hasRecordOfDto($dto) === false) {
            $entity = $this->entityFactory->create($dto);

            return $entity;
        }
        $entity = $this->unitOfWorkHelper->getEntityFromUnitOfWorkUsingDto($dto);
        $entity->update($dto);

        return $entity;
    }