How to inject a service in another service? I am building a custom service, a membership service.
This service can be called from a controller.
But what I don't seem to get working, is to use another service, the QueryFactory, to use in that custom service.

the membership service: 

namespace Drupal\hsbxl_members;
use Drupal\Core\Entity\Query\QueryFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Class MembershipService.
 */
class MembershipService {
  protected $hsbxl_member;
  protected $entityQuery;

  public function __construct(QueryFactory $entityQuery) {
    $this-&gt;entity_query = $entity_query;
  }

  public static function create(ContainerInterface $container) {
    return new static(
      $container-&gt;get('entity.query')
    );
  }

  public function MembershipsAll() {
    $query = $this-&gt;entity_query-&gt;get('node');
    $query-&gt;condition('status', 1);
    $nids = $query-&gt;execute();
    return "Hello World!";
  }
}


services file:

services:
  hsbxl_members.membership:
    class: Drupal\hsbxl_members\MembershipService
    arguments: ['@entity.query']


Can anyone point me out on this?
What am I doing wrong / am I missing?

Tom
The service you need is entity_type.manager:

.services.yml

services:
  hsbxl_members.membership:
    class: Drupal\hsbxl_members\MembershipService
    arguments: ['@entity_type.manager']


MembershipService.php

namespace Drupal\hsbxl_members;

use Drupal\Core\Entity\EntityTypeManagerInterface;

/**
 * Class MembershipService.
 */
class MembershipService {
  protected $hsbxl_member;
  protected $entityTypeManager;

  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this-&gt;entityTypeManager = $entity_type_manager;
  }

  public function MembershipsAll() {
    $query = $this-&gt;entityTypeManager-&gt;getStorage('node')-&gt;getQuery();
    $query-&gt;condition('status', 1);
    $nids = $query-&gt;execute();
    return "Hello World!";
  }
}


The create() method is unnecessary as services use constructor injection.