Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Unity

diab0l edited this page · 6 revisions

Unity from Microsoft is supported via its fluent API of the UnityContainer instance.

Manual Registration

  • RegisterType<Foo>()
  • RegisterType<IFoo, Foo>()
  • RegisterType(typeof(Foo), ...)
  • RegisterType(typeof(IFoo), typeof(Foo), ...)

Chained registrations are also supported, i.e. container.RegisterType<Foo>().RegisterType<IBar, Bar>()

Not (yet?) supported

  • RegisterInstance<TInterface>(...) - ReSharper will not complain about the type being unused, since it must be instantiated.
  • RegisterInstance(typeof(TInterface), ...) - non generic version.
  • Resolve - is it true you can resolve any concrete type with Unity, even if you never registered it explicitly? (answer: Yes it is)
Something went wrong with that request. Please try again.