csharp icon indicating copy to clipboard operation
csharp copied to clipboard

Make `await ListNamespacedServiceAsync` return enumerable

Open dzmitry-lahoda opened this issue 3 years ago • 3 comments

Currently, I have to

(await ListNamespacedServiceAsync(..)).Items.Where(..)

so I it would be nice

(await ListNamespacedServiceAsync(..)).Where(..)``

When I see List in method name, I always mistype Where as list kind of enumerable.

Thank you Sir

dzmitry-lahoda avatar May 25 '22 20:05 dzmitry-lahoda

let me think if an extension method could make life simpler

tg123 avatar May 27 '22 23:05 tg123

Maybe we could consider the foreach extensions

  • https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/extension-getenumerator
  • http://dontcodetired.com/blog/post/ICYMI-C-9-New-Features-Adding-foreach-Support-To-Any-Type

WeihanLi avatar May 31 '22 14:05 WeihanLi

thanks for the idea, the code generator would have to figure out the List result and add a ienumerator delegate to .item or a extension based enumerator

tg123 avatar May 31 '22 15:05 tg123

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 29 '22 15:08 k8s-triage-robot