Wednesday, 5 October 2011

StructureMap Use() vs Add()

StructureMap 'For().Use()' vs 'For().Add()'

If you there's only *one* instance registered against a type, StructureMap goes ahead and assumes that that one is the default.

Use() == the default.  "Anonymous" in some other container's lingo
Add() == named instance (it gets a Guid for the name if you don't set it yourself)..

 Jeremy D. Miller
The Shade Tree Developer

No comments:

Post a Comment