YairHalberstadt / stronginject

compile time dependency injection for .NET
MIT License
849 stars 24 forks source link

Allow Instances and Factory methods to register an IFactory and remove IInstanceProvider #52

Closed YairHalberstadt closed 4 years ago

YairHalberstadt commented 4 years ago

IInstanceProvider<T> and IFactory<T> have identical APIs and it seems pointless keeping them both,

Instead if an [Instance] field/property or a [Factory] method returns something of, or inheriting from, IFactory<T> we should automatically resolve it as a factory.

Then we can remove InstanceProviders, and replace their usages with [Instance] IFactory<T> _instanceProvder;

YairHalberstadt commented 4 years ago

Implemented by #60