Questions tagged [dryioc]

DryIoc is small, fast, capable IoC Container for .NET

DryIoc provides modern take on IoC/DI automation with Simplicity of use, Performance, and Features in mind.

236 questions
2
votes
1 answer

DryIoc RegisterMany implementations of interface

Looking at the wiki for DryIoc, it seems the examples show the reverse of what I need, and I was wondering if the reverse is possible? Wiki (partial example) public interface X {} public interface Y {} public class A : X, Y {} public class B : X,…
furier
  • 1,934
  • 1
  • 21
  • 39
2
votes
1 answer

DryIoc resolve with a func

I'm trying to have objects being resolved as the result of Func<>. But I don't find how to do it. For instance, here I have a variable (function argument) lazyInt (which could be the result of long running computation of some sort) and which result…
Serge Intern
  • 2,669
  • 3
  • 22
  • 39
2
votes
1 answer

PrismDryIoc.Forms AutowireViewModel not working

I created a Prism Unity App (from the prism extension pack - really nice), added 2 new views and set up basic navigation between the views. This all worked fine without any hiccups. What I really want is to use DryIoc (company policy). So I…
Van
  • 600
  • 4
  • 12
2
votes
1 answer

How to use dryioc container from main app in class library

I am new to dryioc so excuse the ignorance:) I would like to understand what the correct approach would be for the following, Creating a console app that creates instance of dryioc container. Register a logger in the container (as singleton). Then…
Del
  • 61
  • 1
  • 9
2
votes
1 answer

Lazy with DryIoc, am I doing it right?

I need to be able to use DryIoc to create Lazy objects. Because I'm working with a legacy application which use a God object and relies on a heavy Dictionary of complexe KeyPair, I'd like to replace each value with a…
Serge Intern
  • 2,669
  • 3
  • 22
  • 39
2
votes
1 answer

DryIoc cannot resolve my boolean instance?

I try to register a class which constructor requires a few string, a ILog and a bool. All in my container is registered as a singleton (set as the default Reuse). But whenever I try to get an instance of that class container.Resolve(),…
Serge Intern
  • 2,669
  • 3
  • 22
  • 39
2
votes
1 answer

DryIoc with Serilog - Setting up Logging Context

We're currently using Autofac and are leveraging the AutofacSerilogIntegration to automatically set up the logging context when an ILogger is injected into a concrete. The integration sets up the logging context with the type the logger is being…
swannee
  • 3,346
  • 2
  • 24
  • 40
2
votes
1 answer

Factory method with string argument

In DryIoc, how do I pass a string argument to a factory method? In the Wiki, there's an example on how to pass another registered class, but I can't seem to figure out how to pass a string. Given the following: public interface…
smolesen
  • 1,153
  • 3
  • 11
  • 29
2
votes
2 answers

Resolve parameters according to the parent tree that triggered the resolve?

I have code similar to this: class A: IA { ... } class B: IB { public B(IA a, ...) { ... } ... } class C1 { public C1(IA a, IB b, ...) { ... } } class C2 { public C2(IA a, IB b, ...) { ... } } What I want is only two instances of A…
Brannon
  • 5,324
  • 4
  • 35
  • 83
1
vote
1 answer

DryIOC ASP.Net WebForms and Task.Run() contexts

There is a problem using DryIOC in a ASP.Net WebForms application that uses Task.Run() to run some code in other threads. We encountered the problem that we can not benefit both HttpContextScopeContext and ThreadScopeContext in our ASP.Net WebForms…
Masud Safari
  • 108
  • 8
1
vote
1 answer

DryIOC scoped services in ASP.NET WebForms

We have an ASP.Net WebForms application and recently in a refactoring scenario, we added DryIOC as an IOC container to it. The sample WebForms project : Link to the test project and a piece of The code is as follows: public class…
Masud Safari
  • 108
  • 8
1
vote
0 answers

Difficulty using DryIOC in Web form

I want use DryIoc container in web form, I use sample code : https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/ReuseAndScopes.md#reuse-and-scopes But every time I ask, I get a new instance from the container : var container = new…
MrMohande3
  • 11
  • 2
1
vote
0 answers

In Prism 8 with DryIoC, how do I mock the IContainerRegistry when I need to unit test code in RegisterTypes?

I have a requirement to access the container directly because Prism's IContainerRegistry doesn't provide me the ability to pass parameters through the constructor of an instance I am registering. However I can't mock IContainerRegistry because I…
1
vote
2 answers

Unity to DryIoC conversion ParameterOverride

We are transitioning from Xamarin.Forms to .Net MAUI but our project uses Prism.Unity.Forms. We have a lot of code that basically uses the IContainer.Resolve() passing in a collection of ParameterOverrides with some primitives but some are…
mnx
  • 11
  • 1
1
vote
1 answer

Update an already injected service DryIoc c#

Hi I have a situation where I need to update a service that I have injected. When I first launch the app I have something like public class MyService:IMyService { public string ValueAPopulatedBeforeLogin { get; set; } public string…
developer9969
  • 4,628
  • 6
  • 40
  • 88