EF Core Dependency Injection Internals

A previous post gave an overview of how dependency injection is used internally by EF Core, and how applications might interact with this. In this post we will look at some of the internal details. This post is aimed at provider writers and people who may want to contribute to the EF source code. Application developers should not need to know any of this.

Continue reading

Advertisements

Dependency Injection in EF Core 1.1

EF Core can interact with dependency injection (D.I.) in two ways:

  • A D.I. container can be used to create DbContext instances
  • EF uses a D.I. container internally for its own services

The first of these was covered in a previous post. This post covers how EF uses dependency injection internally and how it can interact with an external container.

Continue reading

EF Core 1.1 – Creating DbContext instances

This post describes the different ways to create and configure instances of DbContext in EF Core 1.1. This includes:

  • Calling a constructor directly and overriding OnConfiguring
  • Passing DbContextOptions to the constructor
  • Using Dependency Injection (D.I.) to create instances

Continue reading