About .NET, ASP.NET, MVC, C#, WPF, WCF and everything related to .NET and more.

Mugen Injection [WeakReferenceScopeLifecycle]

WeakReferenceScopeLifecycle - создается новый компонент и помещается в WeakReference, до тех пор пока WeakReference будет содержать компонент, он не будет пересоздан.

// Create your MugenInjector.
_injector = new MugenInjector();

var alpha1 = _injector.Get<Alpha>();
// This is a same instance that alpha1.
var alpha2 = _injector.Get<Alpha>();
alpha1 = null;
alpha2 = null;
//Calling GC to clear weakreference.

//This is different instance it did not like was alpha1.
alpha1 = _injector.Get<Alpha>();
// This is a same instance that alpha1.
alpha2 = _injector.Get<Alpha>();

Оставить комментарий
* Bullet List
** Bullet List 2
# Number List
## Number List 2
{"Do not apply formatting"}
{code:language} code here {code:language}.
Supports: aspx c#, c#, c++, html, sql, xml