I'm trying to select a collection into an immutable array in the most efficient way possible.
I'm also want to make it clear the intent of the result set as readonly / immutable / not tracked.
var someCollection = await _dataContext
.Set<someType>()
.AsNoTracking()
.ToArrayAsync();
I can do this then convert to immutable but that seems crazy.
var someImmutableCollection = someCollection
.ToImmutableArray();
I can also just do this:
var someCollection = _dataContext
.Set<someType>()
.AsNoTracking()
.ToImmutableArray();
But this is not async.
Is there a reason why there is no ToImmutableArrayAsync()?
Or is there a better way using async to get an immutable array from efcore?