This video covers dependency injection in ASP.NET Core.
- [Instructor] Now while dependency injection…is not a new concept, and certainly not new…for MBC, what is new is the fact that it is…completely built in to the framework.…So you don't have to bring in Ninject…or Autofac or some other framework,…although you can use custom frameworks as well.…Items are added to the services container…in the Startup.cs, and then you can access them…through constructor injection, method injection…with the FromServices attribute…or through view injection…with the @inject razor command,…and you can also retrieve services through…the ApplicationServices object…as well as the RequestServices method…off of the HttpContext.…
However, inject is the preferred mechanism…if you can make that work.…You can also register custom services,…and there's four main ways that you can register them.…Transient will create a new instance…every time an object is asked for.…Scoped is created once per request,…and that's HTTP request.…Singleton will have a max of one instance…per application,…and instance is also a singleton,…
- Running and debugging ASP.NET Core applications
- Pros and cons of migrating existing applications to ASP.NET Core.
- Built-in dependency injection
- Environment awareness and app configuration
- Web host configuration and SSL
- View components invoked as tag helpers
- Configuration and logging
- Using Razor Pages
- Web API improvements
- Support for creating GDPR-compliant applications
Skill Level Intermediate
Entity Framework Core Essential Training: 1with Phil Japikse3h 20m Intermediate
Use the exercise files3m 37s
1. Get to Know .NET Core
2. ASP.NET Core 1.0
3. ASP.NET Core 1.1
4. ASP.NET Core 2.0
5. ASP.NET Core 2.1
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.