We have been using version 2.5.3 for a while and now we are trying to upgrade to 2.6.1 and have some compatibility issues.
The previous version had StoragePolicy-Classes such as
ThreadLocalStoragePolicyandHttpContextStoragePolicywhich all had a method toDisposeAndClearAll. The new versions seems to have the classes renamed toX_StorageLifecyclean开发者_开发技巧d theHttpContexthas a method calledReleaseAndDisposeand there's even a methodReleaseAndDisposeAllHttpScopedObjectsonObjectFactorywhich I presume does the same. BUT: Where has the same functionality for theThreadLocalStorageLifecyclegone?!We used to call
ObjectFactory.Inject("name", instance)to add named instances for unit tests. It seems as there is no more overload for injecting a named instance?! I am usingObjectFactory.Configure(o => o.For<T>().Use(instance).Named("name")now but that doesn't feel like being the easiest way. What am I missing here?
Seems that "someone" was just lazy ;-) as the functionality is still there but all the shortcuts are missing!
Call "new ThreadLocalStorageLifecycle().EjectAll()" instead.
Call the same method on the ObjectFactory.Container object.
加载中,请稍侯......
精彩评论