I have an overload method - the first implementation always returns a single object, the second implementation always returns an enumeration.
I\'d like to make the m
constraints don't support exclusion, which may seem frustrating at first, but is consistent and makes sense (consider, for example, that interfaces don't dictate what implementations can't do).
That being said, you could play around with the constraints of your IEnumerable overload...maybe change your method to have two generic typings
with a constraint like "where X : IEnumerable
" ?
ETA the following code sample:
void T[] GetOrAdd (string cachekey, Func fnGetItem)
where X : IEnumerable
{
}