title: How to apply dependency injection with static class and method?
body: <p>I have Static Class with Static method which return interface for the service.</p>
  <pre><code>public static class VService
  {
      //This is factory where I am creating object for VPredictionService Class
      // currently just have one
      public static IVService GetVService(VServiceType serviceType, string endPointName)
      {
          if (serviceType == VServiceType.ClassificationSync || serviceType == VServiceType.NERSync)
          {
              return new VPredictionService(endPointName);
          }
          else
          {
              return null;
          }
      }
  }
  
  public enum VServiceType
  {
      ClassificationSync,
      ClassificationAsync,
      NERSync,
      NERAsync,
  }
  
  
  public class VPredictionService : IVService
  {
      string _endPointName;
      public VPredictionService(string endPointName)
      {
          _endPointName = endPointName;
      }
  
      //Implementations for StartVPrediction
      public VResponse StartVPrediction(byte[] data)
      {
          var textData = Encoding.UTF8.GetString(data);
          var result = Predict(textData); // This method return some calculations
      }
  }
  
  public interface IVService
  {
      VResponse StartVPrediction(byte[] data);
  }
  </code></pre>
  <p>One of the other service where I am creating object for VPredictionService and calling StartVPrediction to get calculations.</p>
  <pre><code> public class DocumentParserService
  {
      private Prediction GetVPrediction(string documentText, string classificationModel)
      {
          var byteData = Encoding.ASCII.GetBytes(documentText);
          var service = VService.GetVService(VServiceType.ClassificationSync, classificationModel);
          var result = service.StartVPrediction(data: byteData);
      }
  }
  </code></pre>
  <p>I have logger and repository which I require to pass to Predict method in VPredictionService but I don't want that to get passed from caller DocumentParserService.</p>
  <p>Is there any way I can inject dependency for ILogger and IRepository directly to VPredictionService ?</p>