我使用 Unity,我有一堂课:
public class A
{
[Dependency]
IRepository<User> User { get; set; }
}
我也有B类:
public class B
{
public B()
{
/* In Ninject I would use */
/* Global.Inject(this) */
/* Is it possible to do in Unity? */
}
}
先感谢您!