yield return works for exactly 4 cases:
IEnumerableIEnumerable<T>IEnumeratorIEnumerator<T>
This is because it has to build a state machine internally; a dictionary (etc) wouldn’t be possible with this. You can of course just return a suitable type instead.