Category "dependency-injection"

AttributeError: 'Depends' object has no attribute 'query' FastAPI

So I am trying to write simple function here, but everytime I run swagger I got above mentioned error. Here's my function: def authenticate_user(username: str,

Accessing the parameters injected in ConfigureServices from custom Middleware

I am practicing to learn more about the Dependency Injection and the Middleware in ASP.NET Core and I have faced an issue I can not resolve, so need the assista

Spring4D - How to resolve from container with TComponent parameter to auto factory

For an example I would like to resolve a class passing in a TComponent and TNotifyEvent such as below but the base constructor of TObject gets called and not of

How to call a method on application crash before objects in DI container are disposed? c#

I have a console application that is running in Kubernetes. I want it to send an event through rabbit when it crashes on unhandled exception. Here is simplifie

When to use action injection and when to inject dependencies on the constructor for controllers?

In Symfony you can direct inject a service into a controller function: use App\Service\FooService; class FooController { public function one(FooService $fo

Dagger - Hilt : Do we need to mark all activities with @AndroidEntryPoint

So my question is as I am getting started with Hilt, do we need to mark all activities with @AndroidEntryPoint annotation or can we just create a BaseActivity a

"Repeats modules with scoped bindings or declarations .. with scopes: @javax.inject.Singleton" Dagger 2

I'm trying out the Hilt DI in my test project. I've the following module that's installed in SingletonComponent which in terms of Android is applicationComponen

Hilt injection in Android Services

I want to inject a class in Service. Lets have a look at the code below: class DeviceUtil @Inject constructor() { ... } @AndroidEntryPoint class LocationUpd

Generically Register All Concrete types for Lazy Loading in DI

I want to setup Lazy Loading of registered types in a generic way that does not require me to register each one individually. I can create an extension method t

edit inline angular (change detection strategy, subject, behavior subject)

my output Here is my code: https://stackblitz.com/edit/angular-ivy-w3lop5?file=src%2Fapp%2Fapp.component.html I am just a beginner for few days. I dont understa

How to pass runtime parameters to a ViewModel's constructor when using Hilt for dependency injection?

I'm wondering how to pass runtime parameters to a ViewModel's constructor while using Hilt for DI? Prior to using Hilt, I have a ViewModel that looks like this:

How to access a injected repository from a component's method

Lets say we injected this repository on a plugin/service-container.js import nodeFetch from 'node-fetch' import { AbortController as NodeAbortController } from

Nested FormGroupDirective in child components

There is a problem with FormGroupDirective dependency injection. I have an example of relation component to each other: <app-component-group> <child-

Quarkus Auth Server Disable JWT Issue

i wish to disable the auth server when running in dev mode, which I am able to do so with %dev.quarkus.oidc.enabled=false . But it causes an exception given bel

How to solve Dependency injection and Inconsistent accessibility parameter type '' in .Net 3 Worker service?

I am setting a .Net core worker services that will get some data from the database and pass that to an endpoints. So I am trying to set it up base on my .net MV

How to use a generic HostBuilder in a UWP application

In my WPF applications I use a generic HostBuilder in this way: public partial class App : Application { private readonly IHost _host; public App()

Spring boot autowired service all variable fields are null

Currently I have many spring boot services annotated with @Service. Every service works fine and there are no problems. There is a problem only with LogsService

Object gotten from the NestFactory has all the internal dependencies as undefined - NestJS

I get an object from NestFactory and then I call a function. There is another class injected inside service class. All the dependencies inside the service are n

SwiftUI Dependency Injection

I have a SwiftUI app, its a tab based app struct Tab_View: View { var body: some View { TabView{ Main1_View().tabItem {

Can a Kotlin Object be used as a Spring bean?

Kotlin allows for the definition of singleton objects. In dependency injection (DI) frameworks like Spring or CDI, the life cycle of beans can be defined as sin