如何结合 BindBase() 和 BindAllInterfaces()?
How to combine BindBase() with BindAllInterfaces()?
我们可以将 BindBase() 和 BindAllInterfaces() 结合到某个工厂吗?
kernel.Bind(x =>
{
x.FromThisAssembly()
.SelectAllClasses()
.WithAttribute<SomeAttribute>()
.BindBase();
});
和
kernel.Bind(x =>
{
x.FromThisAssembly()
.SelectAllClasses()
.WithAttribute<SomeAttribute>()
.BindAllInterfaces();
});
.BindSelection((t, baseTypes) =>
baseTypes.Where(bt => bt.IsInterface || bt == t.BaseType))
我们可以将 BindBase() 和 BindAllInterfaces() 结合到某个工厂吗?
kernel.Bind(x =>
{
x.FromThisAssembly()
.SelectAllClasses()
.WithAttribute<SomeAttribute>()
.BindBase();
});
和
kernel.Bind(x =>
{
x.FromThisAssembly()
.SelectAllClasses()
.WithAttribute<SomeAttribute>()
.BindAllInterfaces();
});
.BindSelection((t, baseTypes) =>
baseTypes.Where(bt => bt.IsInterface || bt == t.BaseType))