runxc1 Bret Ferrier
runxc1 Bret Ferrier

Reputation: 8233

How do you set up StructureMap to use a Singleton with the Use<>.For<> syntax

I am using StructureMap with MVC3 I want to set it up to use a few of the objects as Singletons or to give them a Per Request life. All of the examples I see out there are for an older syntax of StructureMap as when I try out the example I see that it is depricated.

How do you do this using the newer Use<>.For<> Syntax?

Upvotes: 2

Views: 571

Answers (1)

Michael
Michael

Reputation: 20069

Using version 2.6.1, this should work:

For<IFoo>().Singleton().Use<Bar>();

Upvotes: 8

Related Questions