Skip to Main Content
ASP.NET Core in Action, Second Edition
book

ASP.NET Core in Action, Second Edition

by Andrew Lock
May 2021
Intermediate to advanced content levelIntermediate to advanced
832 pages
25h 39m
English
Manning Publications
Content preview from ASP.NET Core in Action, Second Edition

10 Service configuration with dependency injection

This chapter covers

  • Understanding the benefits of dependency injection
  • How ASP.NET Core uses dependency injection
  • Configuring your services to work with dependency injection
  • Choosing the correct lifetime for your services

In part 1 of this book, you saw the bare bones of how to build applications with ASP.NET Core. You learned how to compose middleware to create your application and how to use the MVC pattern to build traditional web applications with Razor Pages and Web APIs. This gave you the tools to start building simple applications.

In this chapter you’ll see how to use dependency injection (DI) in your ASP.NET Core applications. DI is a design pattern that helps you develop loosely ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core in Action, Third Edition

ASP.NET Core in Action, Third Edition

Andrew Lock

Publisher Resources

ISBN: 9781617298301Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link