title: Dependency Injection of services into an Entity Framework Core database context
body: <p>I have been attempting to use DI to inject services into my DB Context. For example, a User Resolver service for audit logging purposes. I have some extensions to ChangeTracker that audit created, modified and deleted properties and also an audit logger that logs the changed properties of the entity. For these to work effectively and seamlessly I need to determine the logged in user. In EF Core 1.1, I got this working by simply adding my IUserResolverService to the constructor.</p>
  
  <p>When I attempted to upgrade to 2.0, I started to run into all sorts of issues as the tooling did not handle the extended constructor. I eventually removed it and everything started working, but without a reliable way of determining the logged in user.</p>
  
  <p>I have tried to find an answer to this on many occasions now, and searching only uncovers a mountain of articles about injecting the context itself into things like controllers.</p>
  
  <p>Can this be achieved in EF Core without breaking tooling, etc.? Is there a way to inject a service through Startup ConfigureServices?</p>