container icon indicating copy to clipboard operation
container copied to clipboard

Rename ResolveAll into ResolveNamed

Open ENikS opened this issue 6 years ago • 0 comments

Collections

Original Unity ( up to 4.x) provided limited support for collections. It only allowed resolution of arrays.

T[]

Resolved array would return a collection containing all registrations with non empty names. In other words, all registrations with Name != null will be included. The implementation had an extension method called ResolveAll as a syntactic sugar on top of the implementation to provide more meaningful presentation.

IEnumerable<T>

Unity v5 introduced new resolver for enumerating registrations: IEnumerable<T>.

The enumerable would return collection containing all, named and unnamed registrations.

The conflict

With v5 of Unity, method ResolveAll became misnomer. Instead of resolving all, as name implies, it only resolves named registrations. To correct this inconsistency the name is changed into ResolveNamed

Due to large existing code base that use old extension ResolveAll and to prevent ambiguity, the name will not be reused to represent IEnumerable<T> and will no longer be used in future development.

ENikS avatar Sep 02 '20 16:09 ENikS