dependency-injection Questions

3

Solved

I am developing a CRM by .net core mvc and EF which needs a lot of DB connection to retrieve and update information. From time to time I face this error during debugging, this is a big project with...

5

I am a beginner in Angular and tried to implement global error handling in the application for this purpose I create appErrorHandler class and implement ErrorHandler and I inject Toast Service on t...
Oversold asked 9/1, 2021 at 16:46

2

Solved

I'm working on an ASP.NET Core 5.0 project which has a service that accesses an API. Based on the code below, I'd expect the HttpClient supplied to ToornamentService's constructor to contain the de...

1

I can't figure out how to share my service registrations between my test code that uses Orleans and the test code that is outside of Orleans. I've spent days trying to figure this out. My unit test...
Lutist asked 4/12, 2023 at 20:21

1

We already have inSingletonScope in Insersify JS. What is the purpose of using .toConstantValue? Could anyone let me know when do we want to use .toConstantValue?

8

I have an error concerning Hilt, I"ve been trying to inject a retrofit interface I created using Hilt, Here is the error: java.lang.ClassNotFoundException: Didn't find class "com.kotlin...

4

Solved

I am creating a custom .NET Core ILoggerProvider that requires some dependencies to be passed into its constructor. I believe I am using a fairly common pattern to initialize my logging implementa...
Achaea asked 22/6, 2018 at 15:43

3

Some times interfaces are annotated with @Component annotation. Then my obvious reasoning was that classes that implement such interface will be treated as components as well. But if I am right tha...

4

We have a multi-tenant web application in which a many pages operate per-tenant. As a result many of our interfaces look like this interface ISprocketDeployer { void DeploySprocket(int tenantId);...
Origin asked 3/4, 2014 at 14:34

2

In my Angular app I have a Selector file plan.selectors.ts which has a few really complex Selectors. A lot of calculations are carried out when retrieving the data and some of these calculations ar...
Sevastopol asked 3/10, 2020 at 19:21

2

Solved

I have a UserContext Service where I'll put some basic functionalities ("IsAuthenticated, GetUser etc...) In order to do that, I need to pass the HTTPContext from my WebAPI Controller to my Class ...

1

Solved

I have a multi module project setup like this: app module presentation module (Android module) domain module (Kotlin module) data module (Android module) The dependency graph presentation -&g...

2

I define my strong typed SignalR hub exactly by MS Rules public class OutputMessages : Hub<IOutputMessages> {...} than inject my SignalR hub to conctoller by the same way public class Applic...
Daphinedaphna asked 23/8, 2020 at 0:52

3

I'm using Koin 3.2 which has the new module includes feature. In the official docs, when discussing module linking strategies, there is this paragraph: An important detail to observe is that you c...
Wendellwendi asked 4/8, 2022 at 12:24

2

Solved

I'm writing in Nest.js framework for 3 years and i got the message in by backend-application: WARN [DependenciesScanner] In the next major version, Nest will not allow classes annotated with @Injec...
Backboard asked 26/5, 2022 at 14:8

6

This error occurs while trying to add-migration for the first time. I have added the extension method and my service class public void ConfigureServices(IServiceCollection services) { services.Ad...

3

Here is my interceptor using the new way of intercept of angular, using a function instead of a class export const errorInterceptor: HttpInterceptorFn = (req, next) => { console.log('Intercepte...

4

Need help, where is the issue? I have a configuration class which is loading properties as WebConfig.java @Configuration @PropertySource(value={"classpath:application.properties"}) class WebConf...
Modulation asked 4/10, 2017 at 12:33

3

Solved

I'm currently trying to create a Logger so I can inject it in Unit Tests. I'm following https://mcmap.net/q/109170/-how-to-unit-test-with-ilogger-in-asp-net-core, and it used to work! I then moved ...
Heartburn asked 22/1, 2019 at 21:0

3

Solved

I'm currently refactoring a bloated MVC .NET Core app to a more simpler .NET Core app using Razor Pages and Mediatr. In the MVC approach there's a BaseController that all controllers inherits from...
Decolonize asked 20/2, 2019 at 10:16

3

I had a discussion today where some of my colleagues said that they inject their Angular services like that: constructor(readonly language: I18nService) They said they do this because it prevent...
Iberian asked 25/2, 2019 at 17:43

3

Solved

Getting error below while using dagger-hilt Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateException: Unsupported metadata version. Check that you...
Involucrum asked 21/7, 2022 at 5:39

7

Solved

How can I configure Quartz in .net core to use dependency injection? I using standard .net core Dependency mechanism. In constructor of class that implements IJob, I need inject some dependencies. ...
Leyden asked 10/2, 2017 at 11:2

2

Before keyed services were introduced in .NET 8 you could retrieve all of the instances of a class or interface with IEnumerable<MyType> myTypes like so: Program.cs builder.Services.AddSingle...
Clarke asked 30/11, 2023 at 11:51

3

Solved

In Angular 2+, how can I provide a new instance of an Injectable only if there's no instance existing? I searched and found none so I tried useFactory. This is my code so far: { provide: ColorsSer...
Saiga asked 26/5, 2021 at 19:49

© 2022 - 2025 — McMap. All rights reserved.