title: asp.net core constructor injection with inheritance
body: <p>In my asp.net core application I have dependency classes which are injected to almost all services. So I want to build a base service class to get these dependencies to properties and my services inherit this base service class.</p>
  
  <pre><code>public abstract class BaseService
  {
      protected Foo Foo { get; set; }
      protected Bar Bar { get; set; }
  
      public BaseService(Foo foo, Bar bar)
      {
          Foo = foo;
          Bar = bar;
      }
  }
  public class Service : BaseService
  {
      public Service(IOtherDependency otherDependency) { }
  
      public void Method()
      {
          var value = Bar.value;
          Foo.Do(value);
      }
  }
  </code></pre>
  
  <p>So with the given code it warns me to call base constructor with supplied parameters, however they are the parameters that will be injected on runtime, I don't want it. If I add a parameterless constructor it will not call my parameterized constructor which I need.</p>
  
  <p>I don't want to call or define any class that injected in base service(<code>Foo</code> and <code>Bar</code>) inside my inherited service, how can I do that ?</p>
  
  <p>By the way <code>Foo</code> and <code>Bar</code> classes are injected as singleton to container in case their lifetime are important.</p>