EasyRepository.EFCore
EasyRepository.EFCore copied to clipboard
✨ [FEATURE[ Introduce IAsyncEnumerable methods or remove IEnumerable<> as a parameter and change to ICollection<>
Summary
I propose we change IEnumerable<TEntity>
to ICollection<TEntity>
on the methods which have the entities.ToList()
My thoughts are:
- The IEnumerable is already cast to
.ToList()
so we lose all advantages IEnumerable could offer - IAsyncEnumerable would be nice.. but It will only be compliant with
netstandard2.1
notnetstandard2.0
unless if they perform these steps https://btburnett.com/csharp/2019/12/01/iasyncenumerable-is-your-friend.html - I dislike the 'multiple' iterations and want to fix it.
Solutions:
1.) Change to IAsynEnumerable
or
2.) Use ICollection
instead if IEnumerable
Which do you think would be better?
- For the non-async methods, option 2 is the only solution
- For the async methods, both option 1 and 2 can be applied
Should I make these changes? What are your thoughts on option 1 or 2?