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

Mugen Injection [Priority]

All bindings have priority. You can have multiple identical bindings with different priorities. A list of the available priorities:

  • Standard = 1
  • Low = 2
  • Normal = 3
  • High = 4
An example of how the container sets priority by default:
  • A binding without the condition = Standard
  • A binding with condition = Low
  • A binding with custom condition = Normal
When you register service you can specify the binding priority:
injector.Bind<Alpha>().ToSelf().SetStandardPriority();
injector.Bind<Alpha>().To<Beta>().SetLowPriority();
injector.Bind<Alpha>().To<Bravo>().SetNormalPriority();

var bravo = injector.Get<Alpha>();//Instance of Bravo.

Comments
Leave a Reply
*bold*
_italics_
+underline+
* 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
[url:http://www.example.com]