-
Notifications
You must be signed in to change notification settings - Fork 29
How to Container.RegisterInitializer<TService>(Action<TService>) to use Jot. #25
-
I would like to RegisterInitializer (like SimpleInjector) using PureDI. It is possible?
I need Integrate Jot with my DI: https://github.com/anakic/Jot#ioc-integration (call tracker.Track() on all Form instances after ctor)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 1 reply
-
Yes, it is possible using some implementation of IFactory or generic IFactory. Please see this sample or this.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Yes, this is what I looking for.
Now I use nongeneric IFactory, with [Include(".*View$")] but I cannot filter some classes.
I have Forms and UserControls whose names end with View. How I can filter using base class instead of class name?
When I create a generic IFactory<T> where T : Form) I get There is no implicit reference conversion from SomeUserControlView to Form.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
The "Include" filter works at compile time, but at run time you can perform additional filtering on already filtered types:
var val = factory();
if (val is BaseType) { }
This will work quite efficiently if you reduce the number of types at compile time, type checking is fast.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
It would be nice if V2 could filter by BaseType during complication :)
Beta Was this translation helpful? Give feedback.