Container.get

Get reuse objects by its class

  1. I get(string name)
  2. T get()
    class Container
    T
    get
    (
    T
    )
    (
    )

Parameters

T

Interface type

Return Value

Type: T

Instance as an interface type

Examples

1         interface MyInterface{};
2         class MyClass: MyInterface{};
3         
4 		auto container = new Container();
5 		auto myClassInstance = new InstanceProvider(new MyClass());
6 		container.register!(MyInterface)(myClassInstance)
7 		auto myClass = container.get!(MyInterface)();

Meta