How to use StructureMap with OpenRasta
1 answer
Build it, then refer to the library. Or you could git submodulate it.
Then add the following code to your openrasta project p>
public class DependencyResolver : IDependencyResolverAccessor
{
public IDependencyResolver Resolver
{
get { return new StructureMapDependencyResolver(ConfigureContainer()); }
}
public static IContainer ConfigureContainer()
{
var container = new Container();
container.Configure(c => c.Scan(s =>
{
//normal SM registrations
}));
return container;
}
}
Hope it helps
ps Structure Map is not officially supported, you are probably better off with Castle / Ninject.
+2
source to share