Questions tagged [funq]

For issues relating to the Funq Dependency Injection framework.

Funq is lightweight Dependency Injection container optimised for good performance and memory usage.

It's widely used as ServiceStack's Inversion Of Control container.

64 questions
1
vote
1 answer

Servicestack - Inject class that have constructor

I Have class that have some property injection like this: public class MyRepository { public IBaseRepository BaseRepository { get; set; } //Injected By IoC public IUid Uid { get; set; } // Injected By IoC private static AnotherClass…
reptildarat
  • 1,036
  • 2
  • 18
  • 35
1
vote
2 answers

Extending Service/IService to add common dependencies

I have the need to extend Service/IService to allow me to register additional resources like other DB connections and custom classes that each individual service may need to get a handle to. Is the proper way to do this to subclass Service? Also,…
LiteWait
  • 584
  • 4
  • 21
  • 42
1
vote
1 answer

ServiceStack two Log Implementations console and file / eventlog

Is there a way to have have two implementations of Logger which are triggert ? I'd like to have one for event log and a console logger. In my code I only use the registered ILog. Here the code I currently set my logger LogManager.LogFactory = new…
Boas Enkler
  • 12,264
  • 16
  • 69
  • 143
1
vote
1 answer

Resolving a Dependency with ServiceStack IoC Container

I have a repository that implements MongoRepository which uses generics I'm trying to register the type in the container so far this is what I got: public override void Configure(Container container) { …
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
1
vote
2 answers

Property not being set in constructor by Container

I have a Service created with ServiceStack. I am using Funq for my Dependency Injection as it comes with ServiceStack by default, but this may be behaviour exhibited by other DI containers. I register my types on startup:…
thudbutt
  • 1,481
  • 1
  • 19
  • 32
1
vote
1 answer

How can I resolve ILog using ServiceStack and Funq.Container

The ServiceStack AppHost provides a Funq.Container with which to register types that can be injected into Services as they are constructed. Can this container be used to register an ILog factory that returns an ILog appropriate for the type in…
Jacob Foshee
  • 2,704
  • 2
  • 29
  • 48
1
vote
1 answer

ServiceStack/Funq cannot resolve System.Boolean exception

I've setup a ServiceStack api using the built-in Funq IoC container to resolve my repositories. However, when I call an api method, I get the following exception: Required dependency of type System.Boolean could not be resolved. Last time I…
Carvellis
  • 3,992
  • 2
  • 34
  • 66
1
vote
1 answer

Funq passing existing objects as parameters

I only know how to Register and Resolve new instances. However, I am not sure how to pass existing objects as parameters in to an instance I want to resolve. Q1: interface IPerson { person FindAnOtherPerson(); void MakeFriends(); } class Person…
Tom
  • 15,781
  • 14
  • 69
  • 111
0
votes
1 answer

Funq: A DI Container

I have seen Funq as a DI Container in an example for MVVM. I tried to find documentation for it but could not. Does anyone know of a good documentation source for Funq Many thanks --Avi
user1497197
  • 81
  • 2
  • 10
0
votes
1 answer

Does ServiceStack's default IoC have something similar to ninject's .ToFactory() Method?

Using ninject, I'm able to create an abstract factory using the following syntax from the application's composition root: kernel.Bind().ToFactory(); Does ServiceStack's default IoC container similar functionality? I'd like to implement…
user1431072
  • 1,272
  • 2
  • 13
  • 32
0
votes
1 answer

ServiceStack Funq Container setting public Members to null

Some members of our devteam just spent some time debugging a similar issue. A RegisterAs class used in one of our unittests has a public member: public List Mails { get; set; } When this class is resolved through Funq, the member is set to null,…
Markus Foss
  • 335
  • 4
  • 14
0
votes
1 answer

Service class has a public property that is not resolving

I'm having a little trouble understanding why my Manager class is null within the context of the request handling through this example POST method in the Service class. I registered the Manager and it's dependencies like this example and it seems to…
melmack
  • 95
  • 7
0
votes
1 answer

C# IoC many instances of the same ViewModel with different Id

I'm using FunQ from ServiceStackv3. I need resolve ViewModel from Container for different object Ids. Basically constructor parameter should distinguish between instances (I know it does not work that way, it's example): var vm1 =…
Tomasito
  • 1,864
  • 1
  • 20
  • 43
0
votes
1 answer

Does ServiceStack / Funq support injections of generic members?

My service base class has generic public property public IProvider Provider; which I am trying to inject with container.Register>(c => new AccountProvider()); but that does not work…
Stan Bashtavenko
  • 1,025
  • 11
  • 16
0
votes
1 answer

How to access IHttpRequest from my custom serializer in ServiceStack

We have custom serializers for our Models that protect sensitive data depending on the request path. (For instance, if the request does not start with "/admin"). Up until now, we've tried registering the IHttpRequest with the Funq container on a…
Dema
  • 6,867
  • 11
  • 40
  • 48