从下面代码的第二行,我检索了一个类型列表。我想将此作为 IBusinessObject 列表返回。这可能吗?如果是这样,我将如何去做?
public List<IBusinessObject> RetrieveAllBusinessObjects()
{
var businessObjectType= typeof(IBusinessObject);
List<Type> implementationsOfBusinessObject = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(businessObjectType.IsAssignableFrom).ToList();
return ?;
}