Create a gist now

Instantly share code, notes, and snippets.

@yuta-kaseda /Zen Secret
Created Apr 17, 2017

What would you like to do?
public class ReferenceClass
{
public ReferenceClass()
{
}
}
public class NotReferenceClass
{
public NotReferenceClass()
{
}
}
public class BindClass
{
public BincClass(ReferenceClass rc,NotReferenceClass nrc)
{
//rcは参照できてる
//nrcはnullになっており、参照できていない
}
}
void Bind()
{
//ReferenceClassを登録
Container.Bind<ReferenceClass>().AsSingle();
//BindClassを登録
Container.Bind<BindClass>().AsSingle();
//BindClassをインスタンスにする
Container.Resolve<BindClass>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment