From the course: Practical Application Architecture with Entity Framework Core
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Inversion of control - Entity Framework Tutorial
From the course: Practical Application Architecture with Entity Framework Core
Inversion of control
- [Instructor] Dependency Injection is a way to implement inversion of control in software. Entity Frameworks' flexibility and testability rely on Dependency Injection to function. Extending its use throughout the application is a small step from there, and can provide significant benefit to even very small applications. If a piece of code requires another piece of code, we use the example of a logging method that can directly call it, statically identifying the code that it wants to call. This is straightforward but couples the business code to the logging code. The real logging code is called every time the business code is called. The business code has control over the logging code. This is Inversion of Control. In Inversion of Control, the business code only knows the interface of the dependent code, the logger. The code is written against the interface, and the actual code to execute it is provided at runtime by the framework. Rather than depending on concrete code, it only…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.