Book Image

Dependency Injection in .NET Core 2.0

By : Marino Posadas, Tadit Dash
Book Image

Dependency Injection in .NET Core 2.0

By: Marino Posadas, Tadit Dash

Overview of this book

<p><span id="description" class="sugar_field">.NET Core provides more control than ever over web application architectures. A key point of this software architecture is that it's based on the use of Dependency Injection as a way to properly implement the Dependency Inversion principle proposed in the SOLID principles established by Robert C. Martin</span>.</p> <p><span id="description" class="sugar_field">With the advent of .NET Core, things have become much simpler with Dependency Injection built into the system. This book aims to give you a profound insight into writing loosely-coupled code using the latest features available in .NET Core. It talks about constructors, parameter, setters, and interface injection, explaining in detail, with the help of examples, which type of injection to use in which situation. It will show you how to implement a class that creates other classes with associated dependencies, also called IoC containers, and then create dependencies for each MVC component of ASP.NET Core. You'll learn to distinguish between IoC containers, the use of Inversion of Control, and DI itself, since DI is just a way of implementing IoC via these containers. You'll also learn how to build dependencies for other frontend tool such as Angular. You will get to use the in-built services offered by .NET Core to create your own custom dependencies.</span></p> <p><span class="sugar_field"><span id="description" class="sugar_field">Towards the end, we'll talk about some patterns and anti-patterns for Dependency Injection along with some techniques to refactor legacy applications and inject dependencies.</span></span></p>
Table of Contents (18 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

About the Reviewer

Gaurav Aroraa has his M.Phil in computer science. He is a Microsoft MVP, lifetime member of the Computer Society of India (CSI), Advisory member of IndiaMentor, certified scrum trainer/coach, XEN for ITIL-F and APMG for PRINCE-F and PRINCE-P. He is an Open Source developer, contributor to TechNet Wiki, and the founder of Innatus Curo Software LLC. For over 19 years of his career, he has mentored thousands of students and industry professionals. You can tweet Gaurav on his twitter handle at @g_arora.

He has authored the following books:

  • Building Microservices in ASP.NET Core, Packt Publishing
  • Learn C# in 7 Days, Packt Publishing
  • SOLID Principles Succinctly, Syncfusion
  • ASP.NET WebHooks Succinctly, Syncfusion

 

To my wife, Shuby Arora, and my angel (daughter), Aarchi Arora, who permitted me to steal some time for this book from the time I was supposed to spend with them. To the entire Packt team, especially Prajakta, whose coordination and communication during the period was tremendous.