ipjohnson / Grace

Grace is a feature rich dependency injection container library
MIT License
337 stars 33 forks source link

Ninject Factory functionality #115

Closed sonofaforester closed 7 years ago

sonofaforester commented 7 years ago

Do you support functionality similar to the Ninject Factory extension?

https://github.com/ninject/Ninject.Extensions.Factory/wiki

ipjohnson commented 7 years ago

@sonofaforester some of the functionality is currently supported in the base package Func<...>, Lazy<T>, and custom delegates.

What's not supported at this time is the interface generation. That said I don't believe it would be too hard to implement. I'll look at putting together a Grace.Factory package that would target .netstandard 1.1.

canhazcodez commented 7 years ago

is there a place to see the eta of the various milestones?

ipjohnson commented 7 years ago

@ElMaxxi I'm not sure what the ETA will be for 6.3.0. Hopefully I'll get some time this weekend but I can't make any promises as I have a 2 month old at home and she rules the roost ...

ipjohnson commented 7 years ago

I've added two methods for doing factory generation on the fly ExportFactory<T>() and ExportInterfaceFactories().

I've put in a couple tests that can be found here. Let me know what you think.

ipjohnson commented 7 years ago

I've pushed out a beta version including Grace.Factory. Let me know if you have any suggestions for changes.

sonofaforester commented 7 years ago

Thanks for the quick turnaround! I'll be working on that this afternoon or tomorrow and will let you know.

ipjohnson commented 7 years ago

@sonofaforester I've pushed a new beta version including your change and the recursive support you mentioned earlier.

Let me know how it goes.

sonofaforester commented 7 years ago

This is working like a champ! Now that I understand Grace a little better, I ended up doing Lazy<> injection of most of the factories. Excited to have a nice replacement for Ninject which seems to be dead. Thanks for your quick work on this.

ipjohnson commented 7 years ago

Perfect. I'll look to roll out a release this weekend with this included.