Tuesday, August 26, 2014

StructureMap.ObjectFactory is obsolete

This suggests the "modern" way to make a singleton which brings back an injected dependency in a StructureMap implementation might be like so:

public static BreadcrumbTracker ObtainTracker()
{
   return StructureMap.ObjectFactory.Container.GetInstance<BreadcrumbTracker>();
}

No comments:

Post a Comment