Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Why doesn't OwinEnvironment implement IEnumerable.GetEnumerator? #788

Closed
kchanlee opened this issue Mar 10, 2017 · 4 comments
Closed

Why doesn't OwinEnvironment implement IEnumerable.GetEnumerator? #788

kchanlee opened this issue Mar 10, 2017 · 4 comments

Comments

@kchanlee
Copy link
Contributor

kchanlee commented Mar 10, 2017

In the project Microsoft.AspNetCore.Owin, OwinFeatureCollection implements IEnumerable.GetEnumerator() which looks good.

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public IEnumerator<KeyValuePair<Type, object>> GetEnumerator()
        {
            ...
        }

Why doesn't OwinEnvironment implements IEnumerable.GetEnumerator() same as OwinFeatureCollection? Now (dev branch, Commit 2cafa43) it just

        IEnumerator IEnumerable.GetEnumerator()
        {
            throw new NotImplementedException();
        }
@JunTaoLuo
Copy link
Contributor

Most likely an oversight. However, why are you using the IEnumerable.GetEnumerator specifically instead of the generic IEnumerable<KeyValuePair<string, object>>.GetEnumerator

@JunTaoLuo JunTaoLuo self-assigned this Mar 10, 2017
@JunTaoLuo JunTaoLuo added the bug label Mar 10, 2017
@JunTaoLuo JunTaoLuo added this to the 2.0.0 milestone Mar 10, 2017
@JunTaoLuo JunTaoLuo removed their assignment Mar 10, 2017
@JunTaoLuo JunTaoLuo added the up-for-grabs We will consider contributions label Mar 10, 2017
@JunTaoLuo JunTaoLuo removed this from the 2.0.0 milestone Mar 10, 2017
@davidfowl
Copy link
Member

@kchanlee would you like to send a PR?

@kchanlee
Copy link
Contributor Author

@JunTaoLuo Actually I don't have a real use case. I was reading and learning from the code and found it.

@kchanlee
Copy link
Contributor Author

@davidfowl Sure, I am willing to contribute. Here it is.

@Tratcher Tratcher added this to the 2.0.0 milestone Mar 13, 2017
@Tratcher Tratcher added 3 - Done and removed up-for-grabs We will consider contributions labels Mar 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants