有没有一种流畅的方式来编写以下内容:
var someTypes = GetType()
.Assembly
.GetTypes()
.Where(x => someFilter == true);
foreach(var someType in someTypes)
{
var genericInterface = typeof(IFoo<>).MakeGenericType(someType);
var genericImplementation = typeof(Foo<>).MakeGenericType(someType);
container.Register(
Component.For(genericInterface)
.ImplementedBy(genericImplementation));
}