title: i can't create a static method in Nop.Services.Customers.CustomerService
body: <p>I try to create a static function in <strong>Nop.Services.Customers.CustomerService</strong> for get </p>
  
  <p>customer list in the nop database. I want to call this function in an external Console </p>
  
  <p>Application. But <strong>CustomerService</strong>  class not contains the default constructor.</p>
  
  <p>Please see the constructor code.</p>
  
  <pre><code>  #region Ctor
  
      /// &lt;summary&gt;
      /// Ctor
      /// &lt;/summary&gt;
      /// &lt;param name="cacheManager"&gt;Cache manager&lt;/param&gt;
      /// &lt;param name="customerRepository"&gt;Customer repository&lt;/param&gt;
      /// &lt;param name="customerRoleRepository"&gt;Customer role repository&lt;/param&gt;
      /// &lt;param name="customerAttributeRepository"&gt;Customer attribute repository&lt;/param&gt;
      /// &lt;param name="encryptionService"&gt;Encryption service&lt;/param&gt;
      /// &lt;param name="newsLetterSubscriptionService"&gt;Newsletter subscription service&lt;/param&gt;
      /// &lt;param name="rewardPointsSettings"&gt;Reward points settings&lt;/param&gt;
      /// &lt;param name="customerSettings"&gt;Customer settings&lt;/param&gt;
      /// &lt;param name="eventPublisher"&gt;&lt;/param&gt;
      public CustomerService(ICacheManager cacheManager,
          IRepository&lt;Customer&gt; customerRepository,
          IRepository&lt;CustomerRole&gt; customerRoleRepository,
          IRepository&lt;CustomerAttribute&gt; customerAttributeRepository,
          IEncryptionService encryptionService, INewsLetterSubscriptionService newsLetterSubscriptionService,
          RewardPointsSettings rewardPointsSettings, CustomerSettings customerSettings,
          IEventPublisher eventPublisher)
      {
          _cacheManager = cacheManager;
          _customerRepository = customerRepository;
          _customerRoleRepository = customerRoleRepository;
          _customerAttributeRepository = customerAttributeRepository;
          _encryptionService = encryptionService;
          _newsLetterSubscriptionService = newsLetterSubscriptionService;
          _rewardPointsSettings = rewardPointsSettings;
          _customerSettings = customerSettings;
          _eventPublisher = eventPublisher;
      }
  
      #endregion
  </code></pre>
  
  <p>And Fileds is shows the error when try to call in the static function.</p>
  
  <p>Please see the fields</p>
  
  <pre><code>  #region Fields
  
      private readonly IRepository&lt;Customer&gt; _customerRepository;
      private readonly IRepository&lt;CustomerRole&gt; _customerRoleRepository;
      private readonly IRepository&lt;CustomerAttribute&gt; _customerAttributeRepository;
      private readonly IRepository&lt;FileUpload&gt; _fileuploadRepository;
      private readonly IEncryptionService _encryptionService;
      private readonly ICacheManager _cacheManager;
      private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService;
      private readonly RewardPointsSettings _rewardPointsSettings;
      private readonly CustomerSettings _customerSettings;
      private readonly IEventPublisher _eventPublisher;
  
      #endregion
  </code></pre>
  
  <p>I create a default in CustomerService class.</p>
  
  <pre><code> public CustomerService()
   {
   }
  </code></pre>
  
  <p>and create new function in CustomerService</p>
  
  <pre><code> public virtual List&lt;Customer&gt; GetClients()
      {
          var _cust = _customerRepository.Table;
  
          return _cust.ToList();
      }
  </code></pre>
  
  <p>and call this function in an external console application</p>
  
  <pre><code>    private static CustomerService _customerService = new CustomerService();
      static void Main(string[] args)
      {
          List&lt;Customer&gt; cust = _customerService.GetClients();
  
          ThreadStart start = new ThreadStart(ProcessMails);
          thread = new Thread(start);
          ProcessStatus = 1;
          thread.Start();
      }
  </code></pre>
  
  <p>But when i call this function it's shows the null error.</p>
  
  <p><img src="https://i.stack.imgur.com/rUjn6.png" alt="enter image description here"></p>
  
  <p>It's not possible to create a function in Nop.Core and call in an external application?</p>
  
  <p>Please help.</p>