I have a dictionary whose values I'd like to return to a caller like this:
public ICollection<Event> GetSubscriptions()
{
return isLockDown ? Enumerable.Empty<Event> : subscriptionForwards.Values;
}
Unfortunately, the empty enumerable type is not compatible with the stated return type. Is there another BCL facility for this?
p.s. no, it does not work to cast both targets of the ternary as (ICollection<Event>)