Our great sponsors
-
silverback
Silverback is a simple but feature-rich message bus for .NET core (it currently supports Kafka, RabbitMQ and MQTT).
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
BTW - My use-case is that I am developing nuget packages. My nuget packages are lower level, similar to this: https://github.com/StephenCleary/AsyncEx
I tend to declare the parameter as IReadOnlyCollection because I can safely iterate without extra allocations. I know you could just do a ToList by default but it would mean allocating a few arrays in the process, in worst case. You could be smarter and check if the IEnumerable can be casted to IReadOnlyCollection and perform a ToList only when needed, this would be the most flexible implementation. I sometimes create an extension method for this: https://github.com/BEagle1984/silverback/blob/master/src/Silverback.Core/Util/EnumerableAsCollectionExtensions.cs.