Generic type decorators
See original GitHub issueIs it possible to register the following (assuming MyRepositoryA and MyRepositoryB already registered as implemented intefaces)?
services.AddSingleton<IRepositoryFactory<IMyRepositoryA>, RepositoryFactory<IMyRepositoryA>>(); services.AddSingleton<IRepositoryFactory<IMyRepositoryB>, RepositoryFactory<IMyRepositoryB>>();
etc.
- and of course, thanks for the library!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Advanced TypeScript Techniques: Generics, Decorators, ...
Generics are a way to create reusable code that can work with a variety of different types. They allow you to define a...
Read more >Typescript Decorator with Generic Type
1 Answer. Decorators can't change the structure of the class, this limitation is by design. We can use mixins to achieve mutation of...
Read more >Generic decorators - could they receive some default type ...
A decorator can receive arguments, by being defined as a function ... Generic decorators - could they receive some default type arguments?
Read more >Generics - mypy 1.5.1 documentation
The built-in collection classes are generic classes. Generic types have one or more type parameters, which can be arbitrary types. For example, dict[int,...
Read more >Documentation - Decorators
A Decorator is a special kind of declaration that can be attached to a class declaration, method, accessor, property, or parameter. Decorators use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes it was the latter - scan and register open generic types. But as you point out, that is not necessary if registering open generics using the syntax you showed. I wasn’t aware this was possible so thanks for your help on this - feel free to close the issue, it’s no longer an issue for me.
Thanks again
Oh, are you asking if you can register open generics? I.e.
That’s possible without this library.