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

How to get implicitly created scope from resolved instance in DryIoc?

We've got Unit of Work as an external dependency of ViewModel. Both ViewModel and UnitOfWork implement IDisposable interface for cleanup. ViewModel uses UnitOfWork, but does not dispose it: public class UnitOfWork: IDisposable { public void…
K. Voroncov
  • 189
  • 1
  • 11
2
votes
3 answers

Mysterious authentication error connecting from Dapper but works from EF 6 - same ConnectionString

We have services and repositories loaded by IoC. /* registration in the service class for repository */ container.Register(); /* registration in GUI app from service class and Form class for constructor…
2
votes
1 answer

IoC - resolve WPF windows with injected object parameters

My first attempt on using an IoC container. A program has a number of different type of windows that are typically opened through a menu in MainWindow. However, in principle it could also be further down the chain. These windows usually need…
bretddog
  • 5,411
  • 11
  • 63
  • 111
2
votes
1 answer

How to register a class to IoC in Prism

I write an application with WPF. I use the Prism library with IoC as Prism.DryIoC. I have an AppDbContext.cs class to declare the connection string to the database (here is MongoDB) public class AppDbContext : BaseMongoRepository { public…
mincasoft
  • 311
  • 3
  • 10
2
votes
2 answers

DryIoc Constructor Argument Reused

I have a Container that registers a Presenter class for a View: Container.Register(); The Presenter's constructor takes one argument for its view: public ListCellPresenter(ListCellView view) { this.view = view; } And I have…
alphonzo79
  • 938
  • 11
  • 12
2
votes
2 answers

Unregister view-Viewmodel Prism xamarin dryioc

I have a situation where I need to Unregister a ViewModel and rerregister it . The reason is that at times I want to inject a "fakeservice" rather than the "real one". So if I press the "offline" button I need to unregister the viewModels and…
developer9969
  • 4,628
  • 6
  • 40
  • 88
2
votes
1 answer

Is it possible to pass the policy used when resolving to a factory method, using DryIoc?

I am trying to register objects to the DryIoc container using a factory. void Main() { var container = new Container(); container.Register(); container.Register( made: Made.Of(r =>…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
2
votes
1 answer

CS0121 errors using DryIoc when migrating from PCL to netstandard Xamarin.Forms

I needed to migrate a Xamarin.Forms project from PCL to .netstandard. I use the PCL compatibility nuget package to consume PCLs referenced in the project but I am having a problem with DryIoc that I'm not sure why it is happening. I figured maybe…
russd
  • 31
  • 4
2
votes
1 answer

RegisterMany does not register all interfaces

I am using DryIoc and this is my first experience with a dependency injection framework. Basically I need to register all classes implementing IService as singleton. Of every IService implementation I need to register also all other interfaces. I…
GioviQ
  • 75
  • 1
  • 9
2
votes
1 answer

DryIoc - Register Single for an existing object already created

Is it possible to achieve something like this; var myObjectInstance = new MyObject(); // We have an instance of a class. Container.Register< IMyObject, MyObject >(Reuse.Singleton, myObjectInstance); // For example register it var…
2
votes
1 answer

DryIoc and UseInstance leads to "Expecting the instance to be stored in singleton scope" exception

When I try to obtain instance of object, which depends on parameter registered by UseInstance, I get DryIoc.ContainerException : Expecting the instance to be stored in singleton scope, but unable to find anything here. Likely, you've called…
Igand
  • 1,161
  • 1
  • 15
  • 25
2
votes
1 answer

Resolution status in DryIoc container

Is it possible in DryIoc container to figure out whether some singleton has been instantiated? For instance var container = new Container(); container.Register( Reuse.Singleton ); // var context =…
Mooh
  • 744
  • 5
  • 25
2
votes
0 answers

How to create a wrapper around DryIoC container.OpenScope()?

I created a wrapper around DryIoC container which is just a class that delegates tasks to DryIoC methods ( for example, myContainer.Register() will call dryIoC.Register() ). the goal is just to hide the real implementation behind my interface…
Abdelghani
  • 73
  • 8
2
votes
2 answers

How to migrate a Xamarin.Forms+Prism app to DryIoC from Unity?

I'm trying to change the container to DryIOC of a Xamarin.Forms + Prism app. Visual studio is compiling and starting the app without errors, but when the app starts it doesn't fire App.OnInitialized method keeping the app on a blank screen. What did…
Cleyton T.
  • 231
  • 3
  • 12
2
votes
1 answer

How is a DryIoc container setup if you need different instances of same interface?

I am trying to use DryIoc with a .NET Web API 2 site to create my controllers. I have a situation where my controller needs a processor and the processor needs two instances of a storage class. Here is the basics: public interface IStorage { …