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

ServiceStack Access Ioc container within Custom CredentialsAuthProvider

I've extended the CredentialsAuthProvider provided by service-stack to allow me to authenticate against a Active-Directory instance. The AD access logic is encapsulated within a custom class called AdManager (see below) e.g.: public class…
darthal
  • 543
  • 1
  • 3
  • 12
3
votes
1 answer

NUnit + ServiceStack's Funq AutoWire issue

I've been testing my business logic in ServiceStack 3.9.38 project, and faced a problem when running unit tests separatly leads to success, and running tests all together leads to fail of one of them. After several hours I've made a reproducible…
Pavel Kudinov
  • 405
  • 2
  • 8
3
votes
2 answers

Accessing IHttpRequest or IRequestContext from container

I need to have the resolution of a dependency for my services to be based off the value of an HTTP header in the incoming request. I've tried registering a factory method like so: container.Register(c =>…
rossipedia
  • 56,800
  • 10
  • 90
  • 93
3
votes
1 answer

Constructor Injection with ServiceStack MVC Powerpack + Funq

I'm playing with the demo MVC 3 Internet Application template and I installed the ServiceStack.Host.Mvc NuGet package. I'm having issues with Funq performing constructor injection. The following snippet is working fine: public class HomeController…
Mike Pugh
  • 6,787
  • 2
  • 27
  • 25
2
votes
1 answer

ServiceStack's Funq type registration via reflection?

I've used Castle Windsor quite a bit. It has a really handy facility for registering types via reflection. So for example, I would do things like this at application…
2
votes
1 answer

How do I register NodaTime in ServiceStack?

I am using the latest ServiceStack and want to use NodaTime instead of the .NET DateTime classes. The recommendations I've read show using a property based on IClock, which I've done. Now I need to inject the IClock, but what I've tried is not…
TortillaCurtain
  • 501
  • 4
  • 18
2
votes
1 answer

ServiceStack Funq RequestScope

If I register a type with RequestScope.Request, and then I autowire it in a service, I know the object's lifetime scope will be respected. Will this also hold true if I resolve the type in a non auto wired way, i.e.: var authRepo =…
Cristóvão
  • 255
  • 1
  • 2
  • 11
2
votes
1 answer

Can't Resolve a service using AppHostBase.ResolveService API in ServiceStack 4

I'm using ASP.NET MVC 5 and attempting to resolve a few services using the example: var authService = AppHostBase.Resolve(); authService.RequestContext = System.Web.HttpContext.Current.ToRequestContext(); var response =…
Nadeem
  • 83
  • 4
2
votes
1 answer

Resolving ServiceStack Services in MVC Controllers

Is it possible to register a Servicestack Service as a property in an MVC controller? I ask because I'm experiencing a similar issue to this question: Timeout expired. - Using Db in ServiceStack Service whereby I receive a timeout when I call this…
CallumVass
  • 11,288
  • 26
  • 84
  • 154
2
votes
0 answers

Lock when IEnumerable resolving in ServiceStack project

I have some project which use ServiceStack. I have strange problem with resolving IEnumerable. I have six services implement some logic and one service, which manage they. This is code my service: public class TerminologyManagerService :…
2
votes
1 answer

How to set up IDbConnectionFactory to be autowired/injected when not inheriting Service?

How to set up IDbConnectionFactory to be autowired/injected when not inheriting Service? I some repository class that will be used in another repository class, but not inheriting from the Service class. it look like this: public class…
reptildarat
  • 1,036
  • 2
  • 18
  • 35
2
votes
1 answer

ServiceStack With Funq and FuentNHibernate Sesssion per Request

I'm trying to use FluentNHibernate in ServiceStack with the Funq IoC container on a session-per-request basis and I'm running into a problem where upon the second request to my service, I get an ObjectDisposedException. Shouldn't Funq create a new…
Don Fitz
  • 1,144
  • 17
  • 32
2
votes
1 answer

How to inject or wire up ormlite into ServiceStack repositories?

I want to access the database from a repository rather than the service class (for increased seperation - not sure if this is overkill tho) i.e. public class TodoRepository // : BaseRepository derive the class and inject IDbConnection somehow? { …
fractal
  • 1,649
  • 17
  • 31
2
votes
1 answer

ServiceStack Funq MVC html helper extension

I'm trying to create a MVC html helper extension that have to be declared as a static class, something like this: public static class PhotoExtension { public static IPhotoService PhotoService { get; set; } public static IGalleryService…
Antonin Jelinek
  • 2,277
  • 2
  • 20
  • 25
2
votes
1 answer

Registering same concrete class with RegisterAutoWired and RegisterAutoWiredAs

My question is quite simple. I have to register all implementations by their interface and concrete types. container.RegisterAutoWiredAs(); container.RegisterAutoWired(); I am…
Ufuk Hacıoğulları
  • 37,978
  • 12
  • 114
  • 156