Grace
Grace copied to clipboard
Grace is a feature rich dependency injection container library
I'm trying to wrap my head around the concept of scopes, lifetimes and other more complex features in Grace. To do it, I've created simple use case scenario in which...
I am trying to resolve concrete type with dependency registered in child container, but it throws exception. ``` [Test] public void TestMethod2() { var container = new DependencyInjectionContainer(); var childScope...
I've been using Grace for some time. Thanks! It has been working really well. I've been implementing IInterceptor, but as our code gets more and more async, I'm finding that...
When using the `WithCtorParam` method with a single argument and in need to resolve a dependency with specific key, I know that you can use `LocateWithKey` like this: ``` _.Export().WithCtorParam().LocateWithKey("key")...
I'm trying to resolve multiple services with metadata using a delegate factory but seems this is not supported. I've modified the `LazyMetadata_StronglyTyped` test to illustrate what I'm trying to achieve....
Today I stumbled upon a peculiar (although unintended) behaviour with Grace. It seems as if providing a dependency that inherits from another dependency automatically resolves that dependency. Repro: ```csharp public...
Here's my config, I think everything except the last line is irrelevant to the issue at hand: ```cs var container = new DependencyInjectionContainer(c => c.AutoRegisterUnknown = false); container.Configure(c => {...
I'm trying to export a series of classes, all inheriting from a mutual abstract class: ``` Container.Configure(_ => { _.Export(Assembly.GetAssembly(typeof(AbstractBaseClass)).GetTypes()).BasedOn().Lifestyle.Singleton(); }); ``` When locating these classes: ``` var childClassses =...
It is today possible to check whether a class has already been exported with the `IsExported` method. Unfortunately, it is a bit limited as it isn't able to check what...
A new feature called Source Generators is being developed by Microsoft, to be part of .NET 5 some time in the future. This is a way to implement reflection but...