EasyRepository.EFCore icon indicating copy to clipboard operation
EasyRepository.EFCore copied to clipboard

✨ [FEATURE[ Introduce IAsyncEnumerable methods or remove IEnumerable<> as a parameter and change to ICollection<>

Open jeffward01 opened this issue 1 year ago • 0 comments

Summary

I propose we change IEnumerable<TEntity> to ICollection<TEntity> on the methods which have the entities.ToList()

image

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 not netstandard2.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?

jeffward01 avatar Oct 01 '22 02:10 jeffward01