Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
27 views

I have an Angular 20 app, running Storybook 10. My component works perfectly, however, I'm trying to set up Storybook to mock a navigation link. I just can't seem to get it to work. This is my ...
Brian Kitt's user avatar
Best practices
0 votes
0 replies
60 views

I’m using Koin for dependency injection in an Android app, and I want to provide BluetoothManager through DI. Right now, I have a module like this: val bluetoothModule = module { single<...
Robert Baricevic-Petrus's user avatar
0 votes
0 answers
62 views

I'm migrating from field injection (@Autowired) to constructor-based injection in a Spring Boot application (Java 21), but I'm running into a BeanCreationException when Spring tries to instantiate my ...
Andrea's user avatar
  • 1
Best practices
0 votes
1 replies
37 views

Spring 5.3 Use case: I’ve got an annotation public @interface MyInject { String region(); String type(); } I want to use this annotation in a similar fashion to @Resource(“beanName”) but ...
St.Antario's user avatar
  • 27.7k
-3 votes
0 answers
29 views

I am getting a version mismatch error when using MediatR in my .NET project. What happened: Yesterday my project worked correctly with no errors. Today I updated some NuGet packages by mistake. After ...
YunusTemel's user avatar
Best practices
0 votes
3 replies
59 views

Our application is somewhat of a middleman that transforms data from numerous APIs. Initially to simplify things, we wrote a bunch of specific clients which wrap an instance of HttpClient created in ...
MetallicHydrogen's user avatar
Best practices
0 votes
0 replies
23 views

In Asp.Net (not Core) we have InstancePerRequest which uses tagged matching child scopes. In Asp.Net Core they deprecated InstancePerRequest in favour of InstancePerLifetimeScope which as I understand ...
mark's user avatar
  • 63.6k
-3 votes
1 answer
86 views

I'm learning Clean Architecture and I can't figure this out. Imagine this scenario: I have a ServiceA that calls its repository: public class ServiceA : IServiceA { private readonly IRepositoryA ...
Demian's user avatar
  • 1
3 votes
1 answer
106 views

I'm interested in the options for providing ownership or references to dependencies when doing dependency injection in Rust. I don't mean like a DI framework or anything like that, just the general ...
jacobsa's user avatar
  • 7,875
Advice
1 vote
9 replies
100 views

I'm implementing a simple PHP service container for my personal website blog and want to make sure I'm setting it up correctly. My container has three types of service registration methods: singleton(...
germanshedder's user avatar
0 votes
0 answers
59 views

I'm trying to fully understand how modules DI works and I'm struggling with one thing. I have sample app: -- API MODULE all controllers here -- USER MODULE APPLICATION MODULE DOMAIN MODULE ...
Pyrkosz's user avatar
  • 48
3 votes
2 answers
114 views

I have an instance of a Spring ApplicationContext in a method and I need to "probe" it and decide if: it has been fully refresh()ed at least once so I can be sure that the beanFactory is ...
Kostas Filios's user avatar
0 votes
1 answer
129 views

All my request clients are added, as this works (not only the generation of the client, but the client itself - the request is sent using rabbitmq and I get the response as expected): using var scope =...
ZorgoZ's user avatar
  • 3,758
2 votes
1 answer
79 views

I run into a runtime error when using autofac in combination with hybrid cache and redis. I hope someone can explain why this error occurs. When using autofac to resolve an instance of HybridCache in ...
Elzo Lubbers's user avatar
3 votes
1 answer
57 views

I'm trying to call the handle to return values ​​from the application layer. I'm using the mediator pattern. I've tried calling it, but haven't been able to due to lack of experience. The endpoint: ...
Andres Miguel Campos's user avatar
-3 votes
1 answer
80 views

I have the following 2 classes. MyClass composes MyOtherClasses. Each of them requires different ILogger<foo>: public class MyClass { private readonly ILogger<MyClass> _logger; ...
khteh's user avatar
  • 4,280
1 vote
1 answer
100 views

I have a console app constructed using the following code: public partial class Program { private static async Task<int> Main(string[] args) { Host.CreateDefaultBuilder(args) ...
khteh's user avatar
  • 4,280
1 vote
1 answer
54 views

I have a class Handler with interface IHandler that depends on IService, which in turn has two implementations ServiceA and ServiceB. Then I have a class Consumer which depends on Handler and knows at ...
user5717448's user avatar
1 vote
2 answers
83 views

I am building a component library with Angular 19. I created a component MyComponent that uses a service MyInternalService to store some data and interact with them. MyComponent needs an instance of ...
TCH's user avatar
  • 769
0 votes
3 answers
148 views

Say I have this interface: public interface IExample { string GetSupportedExtension(); void DoWork(Stream input); } a concrete implementation like: public class PdfExample : IExample { ...
Kiblinix's user avatar
2 votes
0 answers
69 views

I'm using the Micronaut framework, and using ConfigurationProperties to load application config into an injectable bean. This has worked well so far, but I'm now stuck on loading nested objects into a ...
Kris Harper's user avatar
  • 5,922
2 votes
1 answer
128 views

I'm setting up an Android project, where I've separated the code into different modules to have a bit of a cleaner structure. The modules are presentation, domain, data, di and app. I am including a ...
binkypv's user avatar
  • 65
0 votes
1 answer
63 views

I have the following code in my Program.cs to implement my custom feature provider: builder.Services.AddScoped<IFeatureDefinitionProvider, DatabaseFeatureProvider().AddFeatureManagement()....
Cef's user avatar
  • 949
1 vote
0 answers
75 views

I currently have a ServiceProvider that registers certain types from the current assembly within one container. I am trying to implement a separate prism dialogservice that would register only ...
gwiz_kid's user avatar
  • 143
-2 votes
4 answers
146 views

I'm working on a .NET application where every command/query handler needs access to three shared services: IValidator, ISecurity and ILogger. Rather than manually injecting these into each handler ...
Mahmudul Hasan's user avatar
1 vote
2 answers
119 views

I want to create a repository base class, every service should inherit from this BaseService. This is my code: public class BaseService<TEntity, TAddDto, TUpdateDto, TEntityDto> : IBaseService&...
ross's user avatar
  • 23
1 vote
0 answers
61 views

I have an ASP.NET Core 8 app with a long-lived service that refreshes an in-memory cache on a timer. I registered the service as a singleton (it’s a hosted background worker), and it needs to query ...
Michael Ding's user avatar
1 vote
1 answer
111 views

Consider these model classes: [JsonPolymorphic(TypeDiscriminatorPropertyName = "$type")] [JsonDerivedType(typeof(A), typeDiscriminator: nameof(A))] [JsonDerivedType(typeof(B), ...
aepot's user avatar
  • 4,864
0 votes
2 answers
98 views

I have a .NET 4.7.2 console application that uses .NET Generic Host and has 2 background services. One of them (dependent) should start its work only after another one (base) has completed its ...
bairog's user avatar
  • 3,539
0 votes
1 answer
75 views

The code is used in many projects and works but in one service sometimes an error occurs: "InterfaceError: (sqlalchemy.dialects.postgresql.asyncpg.InterfaceError) <class 'asyncpg.exceptions....
Раенко Тимофей's user avatar
1 vote
1 answer
130 views

C# and .NET 8, using .NET DI framework and IOptions. I have an option class: public class MyOptions { public string Name { get; set; } } Then I have a service class that needs an instance of ...
Kjell Rilbe's user avatar
  • 1,623
0 votes
0 answers
57 views

I have an ASP.NET Web API project using Autofac for dependency injection. I register a factory for creating ICommandExecutor based on an enum: builder.Register<Func<CommandType, ICommandExecutor&...
Pulkit Sharma's user avatar
1 vote
1 answer
120 views

I'm trying to use injector to inject a tuple[str, str], but it doesn't work. import injector from typing import NewType Foo = NewType("Foo", tuple[str, str]) class MyModule(injector.Module):...
zyxue's user avatar
  • 9,140
0 votes
1 answer
96 views

I have the following code in a basic .NET MAUI app. My main page: <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/...
Brudi_Voeller's user avatar
2 votes
2 answers
118 views

I have situation like this: I have two Blazor components, both using dbContext and I get popular error A second operation was started on this context instance before a previous operation completed. ...
Vlado Pandžić's user avatar
4 votes
2 answers
138 views

I have an abstract base class that used to accept a service via constructor injection: export abstract class BaseEditEventClass<T> extends BaseFormClass { constructor(protected _service: ...
Raphaël Balet's user avatar
0 votes
1 answer
68 views

I’m using Autofac with ASP.NET Web API, and I have multiple filters registered with Autofac’s .AsWebApiAuthorizationFilterFor<>() API. What’s happening: These filters are InstancePerRequest. ...
Pulkit Sharma's user avatar
1 vote
0 answers
67 views

I have a label provider for my model tree view: public class ModelTreeLabelProvider implements ILabelProvider { @Inject IWorkbench workbench; @Override public Image getImage(Object ...
Árpád Magosányi's user avatar
0 votes
0 answers
65 views

I have a CacheCreation class that prepares config for an OkHttp interceptor. It’s created during DI on app launch, and we currently use runBlocking so the object graph is ready before the first ...
Ajay's user avatar
  • 926
1 vote
0 answers
74 views

My microservice uses an external dependency which is a JAR build by my company. I can't figure why the bean is not found. *************************** APPLICATION FAILED TO START ***********************...
Ryley38's user avatar
  • 403
1 vote
1 answer
55 views

My Application class currently works as both the main application class and osgi bundle activator: @Singleton public class Application implements IApplication, BundleActivator { public static ...
Árpád Magosányi's user avatar
0 votes
1 answer
100 views

I wanna have a dynamic module which should take care of registering mongoose for me. Right now I have a problem with injecting the options asynchronously when I am invoking MongooseModule.forRootAsync(...
Mohammad Jawad Barati's user avatar
4 votes
0 answers
61 views

I’m a contributor of the OpenSource project VanillaBP which is providing hexagonal architecture to business processing applications using process engines. In the past VanillaBP was only available to ...
Stephan Pelikan's user avatar
0 votes
0 answers
50 views

I am using an ASP.NET Core 9.0 Web API with C#. My application setup uses L1 Cache using FusionAPI and L2 is Garnet Server for distributed layer of cache. The following code snippet is from my Startup....
Creative Learner's user avatar
-1 votes
1 answer
139 views

In my C# ASP.NET Core project, I have a class that is currently instantiated using a parameterless constructor. This class is used in hundreds of places throughout the solution. I now need to refactor ...
Nikolai Tikhonov's user avatar
-1 votes
3 answers
106 views

The first method is the normal code execution. The second method is the one that is commented out. Isn't returning an instance of a class from a newly created standalone service provider the same as ...
Bob Bobber's user avatar
0 votes
0 answers
131 views

I'm working with keyed services in .NET 9 and trying to inject IKeyedServiceProvider directly into my constructors, but I'm getting a DI container error unless I manually register it. According to the ...
Mathias F's user avatar
  • 16k
1 vote
1 answer
149 views

I want to load all types from an assembly and register them for dependency injection, using the following reflection-heavy method: using System.Reflection; namespace Server { public static class ...
Nitrox Tank's user avatar
1 vote
2 answers
245 views

I'm using .NET 9, WinUI 3, CommTk.mvvm, Microsoft DI. I have 3 projects in the solution: WinUI 3 (the interface) WinUI 3 class library (user controls to be used in multiple WinUI 3 projects) C# class ...
Terrence's user avatar
  • 2,844
1 vote
1 answer
59 views

I'm looking at a way to resolve dependencies using keyed services. I have a very simple interface (for now): public interface ITest<T> { T Get(string key); } With two very simple ...
Jon Selby's user avatar
  • 532

1
2 3 4 5
542