ExRam.Gremlinq icon indicating copy to clipboard operation
ExRam.Gremlinq copied to clipboard

Add `ToImmutableArrayAsync` in addition to `ToArrayAsync`

Open xperiandri opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. We need to have ImmutableArray as output but preferably without an unnecessary allocation of an array.

Describe the solution you'd like Add ToImmutableArrayAsync methods in addition to ToArrayAsync

Describe alternatives you've considered Convert array to ImmutableArray with unnecessary allocation

Consider sponsoring me I can contribute the feature if you approve

xperiandri avatar Dec 05 '23 21:12 xperiandri

There is always ToAsyncEnumerable on any query, which you can do anything with (ToImmutableArray should be available in either System.Linq.Async or System.Interactive.Async). It's an easy extension method, I'm not sure it should go into the main library.

danielcweber avatar Dec 06 '23 08:12 danielcweber

Sounds great, thanks!

xperiandri avatar Dec 07 '23 20:12 xperiandri

@danielcweber I've also discovered that awaiting IValueGremlinQuery returns an array image How can I return ImmutableArray here?

xperiandri avatar Dec 07 '23 20:12 xperiandri

Closing. The feature can easily be added by an extension method.

danielcweber avatar Apr 29 '24 18:04 danielcweber