Questions tagged [tinyioc]

a .NET-based Inversion of Control container for small projects & libraries.

75 questions
3
votes
1 answer

Nancy IoC per request auto registration

We have an ASP.NET REST service implemented with Nancy (and TinyIoc), which interfaces with a quite large legacy application. We would like to transition to full dependency injection. At the moment most of our modules instantiate the controllers…
Rassi
  • 1,612
  • 14
  • 21
3
votes
1 answer

NancyFx ConfigureRequestContainer

I am trying to figure out how the NancyFx request container works, so I created a little test project. I created a this interface public interface INancyContextWrapper { NancyContext Context { get; } } With this implementation public class…
Jay Pete
  • 4,123
  • 4
  • 35
  • 51
3
votes
3 answers

Register Specific Module Constructor

I would like to inject different strings into each of my module's contructors. I register a factory method which constructs the module. I can then call container.Resolve() and all is well. For some reason though when Nancy tries to resolve my…
Despertar
  • 21,627
  • 11
  • 81
  • 79
3
votes
1 answer

AsPerRequestSingleton() registration using Factory method with TinyIOC Container

I'm looking into TinyIOC for ASP.NET MVC application. What I'm trying to do is register some interface as singleton per request using factory method. var container = TinyIoC.TinyIoCContainer.Current; container.Register((c, n) =>…
Shaddix
  • 5,901
  • 8
  • 45
  • 86
3
votes
1 answer

Inject named registration in TinyIoC

I have an interface IRofl with an implementation called DefaultRofl with the following constructor signature: public DefaultRofl(ICanHasCheezburger cheez) ICanHasCheezburger has several implementations, of which I need to resolve more than one…
TeaDrivenDev
  • 6,591
  • 33
  • 50
2
votes
0 answers

Objects created by AsPerRequestSingleton() are not disposed automatically

I'm trying to use dependency injection with TinyIOC in NancyFX. What I intend to do, is have one SqlConnection per request which should be closed automatically. What I have done so far, is create a CustomBootstrapper, which overrides the…
2
votes
0 answers

Property Injection in NancyFx Module

For e.g I have NacyModule like: public class HomeModule : NancyModule { public ILogger Logger { get; set; } public HomeModule() { Get["/"] = _ => "ok"; } } I now about constructor injection, it's work ok, but is there a way to…
Slava Bobik
  • 31
  • 1
  • 2
2
votes
1 answer

Resolve concrete type with constructor arguments using TinyIoC

I have a Nancy API and have created a custom Bootstraper who inherits from DefaultNancyBootstrapper. I also have the concrete type ConcreteFoo which i would like to bind to self in request scope and pass a specific constructor argument. public…
Manolis
  • 728
  • 8
  • 24
2
votes
1 answer

ReactJS.Net on MVC5 fails to resolve dependency

I'm trying to set up an ASP.Net MV5 application to work with ReactJS.Net, including server side rendering and bundling. Unfortunately, it fails with this exception: An exception of type 'React.TinyIoC.TinyIoCResolutionException' occurred in…
Steve B
  • 36,818
  • 21
  • 101
  • 174
2
votes
0 answers

Beginning (Tiny)IOC: Bootstrapping across multiple projects in solution

I am exploring TinyIOC as part of learning the IoC concept. I have the basics down but I was wondering, when having multiple project in a solution, if I could do the bootstrapping for the relevant classes in their own project (passing the ioc…
Corstiaan
  • 1,114
  • 15
  • 34
2
votes
0 answers

UnitTesting Nancy

I have two unit test projects that test different Nancy modules. Both projects create a fake bootstrapper with something like this: protected override void ConfigureApplicationContainer(TinyIoCContainer container) { …
Ilya
  • 995
  • 1
  • 11
  • 17
2
votes
1 answer

TinyIoC.TinyIoCResolutionException: Unable to resolve type: on ipad deployment

I'm getting TinyIOC Unable to resolve type exception. I have developed my app using Xamarin studio for ipad. In simulator it is working fine. But on deploying ipad i'm getting below error. TinyIoC.TinyIoCResolutionException: Unable to resolve type:…
user2996219
  • 21
  • 1
  • 2
2
votes
1 answer

Properly registering DataContext for NancyFX

I'm using NancyFX and Highway.Data + Entity Framework for an API project. My module has a dependency on a repository, which has a dependency on an DataContext. I need that DataContext to be registered and include the connectionstring from…
Jake Stevenson
  • 3,009
  • 6
  • 35
  • 40
2
votes
3 answers

Using Nancy + TinyIoC to inject dependencies via Quartz JobFactory

So I'm using Nancy + TinyIoC to run a small webservice. This works. Now I need to create a Quartz job which needs some of the same dependencies and ideally I would like to use Nancy's TinyIoC to inject these, as explained in the Quartz…
Mikkel Løkke
  • 3,710
  • 23
  • 37
1
vote
1 answer

Why is TinyIoC not picked up in my Xamarin.Android project when added using nuget?

So I installed TinyIoC v1.3.0 using nuget in my Xamarin.Android project, its in the references, but I cannot type using TinyIoC; without a compile error. I would like to understand why this is? PS. I know I can use the TinyIoC.cs file directly, but…
Colton Scottie
  • 807
  • 1
  • 8
  • 22