You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core)!: Improve DI robustness by removing unsafe casts
This commit addresses the fragility of using `Unsafe.As` for handling collections resolved from the service provider. This was causing potential runtime exceptions when using DI containers (like Autofac) that resolve `IEnumerable<T>` to `List<T>` instead of an array.
The unsafe casts have been replaced with safer, more idiomatic C# patterns that provide a zero-allocation fast path when the underlying collection is an array, while gracefully handling any other `IEnumerable<T>` implementation by converting it to an array.
This change significantly improves the library's robustness and compatibility without a meaningful performance regression for the common path.
BREAKING CHANGE: While unlikely to affect users, this changes the internal handling of collections and is a fundamental fix to the library's core resolution logic, warranting a major version bump for safety.
Resolves#29
0 commit comments