2

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?

runxc1 Bret Ferrier
  • 8,096
  • 14
  • 61
  • 100

1 Answers1

8

Using version 2.6.1, this should work:

For<IFoo>().Singleton().Use<Bar>();
Michael Shimmins
  • 19,961
  • 7
  • 57
  • 90