Hi suppose these 2 methods:
private List GetProviderForType(Type type)
{
List returnValue = new
An important part of this question is "how big is the data"? How many rows...
For small amounts of data, list is fine - it will take negligible time to allocate a big enough list, and it won't resize many times (none, if you can tell it how big to be in advance).
However, this doesn't scale to huge data volumes; it seems unlikely that your provider supports thousands of interfaces, so I wouldn't say it is necessary to go to this model - but it won't hurt hugely.
Of course, you can use LINQ, too:
return from provider in _objectProviders
where provider.Key.IsAssignableFrom(type) ...
select provider.Value;
This is also the deferred yield
approach under the covers...