StructureMap - ObjectFactory will be removed in a future 4.0 release.

on Tuesday, September 23, 2014
If you use a StructureMap maybe you will get the following warning:

Class 'StructureMap. ObjectFactory' is obsolete: ObjectFactory will be removed in a future 4.0 release of StructureMap. Favor the usage of the Container class for future work

The ObjectFactory is a wrapper which provides a single static container instance. The simplest way to avoid problems in the upcoming 4.0 release of structure map is to take a IContainer instance in the constructor like this http://pastebin.com/xczLLVTE.
Information about the configuration for IContainer you can find under http://docs.structuremap.net/UsingTheContainerOutsideOfObjectFactory.htm.

0 comments:

Post a Comment