Monday, December 17, 2007

Generic collection and argument matching

Given that ConcreteRule implements IFilterRule interface, is this code valid?


FilterResults(List < object> objects, IList < IFilterRule> filters)
{
...
}

IList < ConcreteRule> filters = new List < ConcreteRule>();
FilterResults(..., filters);



Is it possible to pass IList as a paramater for IList ?

No comments: