Category "dependency-injection"

How to log retries from Polly with ILoggerFactory

Or: How to log from a static method. From https://github.com/App-vNext/Polly you have examples like this one where a logger is magically available: Policy .Ti

Blazor Cannot provide a value for property 'ScopeFactory' on type 'MyComponent' because the property has no setter

I'm writing Blazor WASM app in .NET 6. The app works as it should in Debug when running from Visual Studio 2022, but when I deploy it as a static site using dot

ASP.NET Core Web API - Cannot instantiate implementation type 'System.Net.Http.IHttpClientFactory' for service type

I am trying to use Dependency Injection to register service in ASP.NET Core-6 Web API. I got this interface: public interface IHttpClientService { Task<T

Blazor Server App MVVM-Pattern: Get notifyed in parent from child component change of App-State via a serviceclass in Startup.cs

I work on a Blazor-Server-App and try to follow MVVM pattern. My problem is, that I don't understand why a parentpage is not 'auto refreshed' after a property i

Apache spark, is it possible to have Google guice as dependency injection technique

Is it possible to use Google guice as dependency injection provider for a Apache spark Java application? I am able to achieve this if the execution is happening

Avoiding generic class with many type parameters, when the consumer of those types are tightly coupled

I am trying to come up with a way to do this where I can have type safety but also loose coupling of a couple of different components in my class. I am running

How to resolve a circular dependency in nest js?

I have my app.module that imports UserModule and AuthModule. @Module({ imports: [UserModule, AuthModule], controllers: [AppController], providers: [AppSer

Field mailSender .. required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found

I'm currently trying to build an email registration process with an email confirmation. I use the JavaMailSender for this. Unfortunately, I am currently getting

How can I build an IOptionsMonitor<T> for testing?

For the normal IOptions interface, you can manually build an instance e.g. this SO question. Is there any equivalent way to make an IOptionsMonitor instance wi

Best strategy for creating a child container (or isolated scope) with Microsoft.Extensions.DependencyInjection

In my AspNetCore application, I process messages that arrive from a queue. In order to process a message, I need to resolve some services. Some of those service

.Net MAUI - AppShell navigation & dependency injection

I'm playing around with .Net Maui, AppShell and dependency injection. I try to call a page with a constructor which takes the ViewModel of this page as paramete

How do I register a HandlerInterceptor with constructor dependencies in Spring Boot

My use case is running custom code before a controller method by annotating methods. HandlerInterceptor seems the way to go but it seems impossible to inject d

ASP.NET Core IHostedService manual start/stop/pause(?)

I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHoste

ASP.NET Core IHostedService manual start/stop/pause(?)

I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHoste

ASP.NET Core IHostedService manual start/stop/pause(?)

I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHoste

MapStruct not autowiring with Kotlin and Spring Boot, built using Gradle

I have the following parts in my gradle file: apply plugin: 'kotlin-kapt' ... compile("org.mapstruct:mapstruct:1.3.0.Final") kapt("org.mapstruct:mapstr

Are Angular Service Modules still required?

In the angular docs, it lists the types of feature modules that one can implement. One of those being a service module. https://angular.io/guide/module-types

Where is the Balance Between Dependency Injection and Abstraction?

Many Architects and Engineers recommend Dependency Injection and other Inversion of Control patterns as a way to improve the testability of your code. There's n

.NET Core console app Mediatr command handler doesn't get called

I'm facing a problem that Mediatr command handler is not called. I have the following solution structure. Project.sln -> Application layer (.NET standard cl

Is it possible to switch Azure functions standard DI container for another?

Currently I am using DI in azure functions the standard way public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder b