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
4
votes
2 answers

Avoid singleton repository (DryIoc) when using dependency injection

I recently created a solution and thought I would try out the DryIoC container to handle dependency injection. Now, as with many other DI solutions that I have used, the default scope for object reuse is transient. This however seems to be posing a…
4
votes
2 answers

How to register object in Dryloc (IOC)

I decided to change IOC in my C# app. It moves from Unity to Dryloc. My problem is that I dont know how to register object in container. In Unity it works like this: AppConfiguration config = new AppConfiguration(){...} var container = new…
P.K.
  • 1,746
  • 6
  • 25
  • 62
4
votes
1 answer

DryIOC Container Contents

StructureMap has a super-useful debug method on the Container class called WhatDoIHave() It shows every type in the container along with its lifecycle, guid and a bunch of other info. It's useful for debugging. There's some info…
reach4thelasers
  • 26,181
  • 22
  • 92
  • 123
3
votes
1 answer

DryIoc - Register multiple instance with ID

I want to register multiple instances of a class in a container. Each instance is identified by its ID property. public interface MyInterface { string Id { get; } } public class MyImpl : MyInterface { public string Id { get; } public…
ttact
  • 33
  • 4
3
votes
2 answers

Scanning Assemblies with DryIoc

I'm trying to use the DryIoc Mef library to scan all assemblies with the Export Attribute I see this link about Mef with DryIoc I changed the method to RegisterExports, but the IGreeter property is not being injected. If I register each one by…
Nick Turner
  • 927
  • 1
  • 11
  • 21
3
votes
1 answer

How do I Configure the Module Catalog in Prism using DryIoc instead of Unity?

I'm working with the Prism Library WPF Samples here (specifically, this one). I'm trying to convert the sample's bootstrapper from using the Unity container to DryIoc. The original code looks like this: class Bootstrapper : UnityBootstrapper { …
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
3
votes
1 answer

Re-instantiate a singleton with Prism in Xamarin Forms

How can I dispose and re-instantiate a singleton with Prism/DryIoC in Xamarin Forms? I'm working with Azure Mobile Apps for offline data. Occasionally, I need to delete the local sqlite database and re-initialize it. Unfortunately the…
Phil Figgins
  • 796
  • 1
  • 8
  • 22
3
votes
1 answer

Using Lazy<> with Prism.DryIoc.Forms gives "container is garbage collected" exception

We're using Prism.DryIoc.Forms to create apps with Xamarin.Forms. To minimize the startup time of the app we are using the Lazy<> pattern for classes with a lot of dependencies. This used to work fine with Prism.Unity.Forms. However, I can't get it…
Jacco Dieleman
  • 1,316
  • 14
  • 14
3
votes
2 answers

Xamarin Forms, Prism Forms & IoC

I have a Xamarin Forms application that I originally developed using Prism and Unity. I am finding Unity to be rather slow when first resolving an object though once that first time has passed all subsequent resolutions of the same object type are…
Martin Robins
  • 6,033
  • 10
  • 58
  • 95
3
votes
0 answers

Cache DryIoc container in tests

When profiling unit/integration tests I see one of the main CPU/Time contributor is DryIoc delegates compilation. Currently tests recreates and re initialize container for the every test. Basic container initialisation is always the same, the…
3
votes
2 answers

LoggingFactory disposed on second call

I've just updated one of my ASP.NET Core projects to version 1.1, and since that I'm getting the following error (works fine on first call but fails on the following) Cannot access a disposed object. on the following line: private ILogger…
smolesen
  • 1,153
  • 3
  • 11
  • 29
3
votes
1 answer

how to resolve an instance of a specific type (known at runtime) that implements an interface using DryIoc.Container

the title is, maybe, misleading but basically I want the DryIoc.Container to resolve a specific implementation of an interface whose type (the type of the class the implements the interface) is given at runtime ( multiple implementations of the same…
Abdelghani
  • 73
  • 8
3
votes
2 answers

DryIoc.WebApi Setup

I'm exploring the use of DryIoc in a .NET WebAPI application and have noticed a strange behavior with the initialization steps. In a simple test webapi application, I have the following DryIoc registration class which gets called immediately after…
Colby
  • 85
  • 1
  • 2
  • 7
3
votes
1 answer

DryIOC Event Aggregator

I'm trying to Implement an event aggregator using DryIOC. I have an Event dispatcher as follows: public class DryIocEventDispatcher : IEventDispatcher { private readonly IContainer _container; public DryIocEventDispatcher(IContainer…
reach4thelasers
  • 26,181
  • 22
  • 92
  • 123
2
votes
1 answer

DryIoc Call async initialization method before instance resolve

I have a class A. It must be a singleton and the async Initialization method must be called when it is created. I did not find suitable functionality in the DryIoc documentation. It seems to me that the RegisterDelegate method is the closest, but it…
EgoPingvina
  • 734
  • 1
  • 10
  • 33
1
2
3
15 16