search

This post describes one of the changes to Startup when moving from an ASP.NET Core 2.x app to .NET Core 3; you can no longer inject arbitrary services into the Startup constructor.

Bharat Dwarkani shared on Nov 24, 2019
image
andrewlock.net
bookmarks
share
visibility15
visibility15 share bookmarks

In many cases, you’ll want to ship MVC controllers, possibly views or tag helpers, etc… as part of your class library. To do this correctly you’ll want to add your assembly to ASP.NET’s “Application Parts” on startup. Its quite simple to do but you might want to make sure you are not enabling all sorts of services that the user of your library doesn’t need.

Bharat Dwarkani shared on Sep 21, 2019
image
shazwazza.com
bookmarks
share
visibility5
visibility5 share bookmarks

DI will help us to simplify the management of all our dependencies. Services are registered in the net core container specifically in the Startup class. The container is responsible for creating and disposing of all service instances or in other words, it’s responsible for the life-time of all services registering in.

Bharat Dwarkani shared on Sep 15, 2019
image
fmoralesdev.com
bookmarks
share
visibility1
visibility1 share bookmarks

You have probably wondered whether it is possible to manipulate different instances of the same service according to a certain context in your application. Well, know that it is possible. I have prepared in this article a concrete example of dynamic dependency injection in a multitenant WebAPI context: for the same service (interface) it is possible to invoke the concrete instance appropriate for the current tenant.

Bharat Dwarkani shared on Aug 30, 2019
image
anthonygiretti.com
bookmarks
share
visibility24
visibility24 share bookmarks

We all probably know how to inject an instance of the interface to the class using dependency injection in ASP.NET Core. But how can we inject all instances of the interface to some class, let’s say, controller, using dependency injection? The trick is simple and it’s shown in this blog post.

Bharat Dwarkani shared on Aug 18, 2019
image
gunnarpeipman.com
bookmarks
share
visibility5
visibility5 share bookmarks
add