-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Pri2Indicates issues/PRs that are medium priorityIndicates issues/PRs that are medium priorityarea-System.Collectionsdotnet-api/produntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Making PeopleEnum class is not needed, when you use foreach without custom sort of output. Instead of it just call GetEnumerator() from _people. _people - is array of Person objects. And arrays of any kind of object have GetEnumerator method.
Write public IEnumerator GetEnumerator() in next way:
{
return _people.GetEnumerator();
}
Class PeopleEnumClass is not needed and may be deleted.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 87006da9-9d40-cb2e-b516-715ea36cdbea
- Version Independent ID: 5c32a764-8844-e344-a42b-8dd1177fa32f
- Content: IEnumerable Interface (System.Collections)
- Content Source: xml/System.Collections/IEnumerable.xml
- Product: dotnet-api
- GitHub Login: @mairaw
- Microsoft Alias: mairaw
laurentksh
Metadata
Metadata
Assignees
Labels
Pri2Indicates issues/PRs that are medium priorityIndicates issues/PRs that are medium priorityarea-System.Collectionsdotnet-api/produntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner