[Proposal] Target typed generic type parameter #8666
Answered
by
HaloFour
hillin
asked this question in
Language Ideas
-
This is kind of a generalization of target typed new. Example: public MyService MyService => Inject<MyService>();
// and a whole lot of other injections
private T Inject<T>() => ServiceProvider.GetRequiredService<T>(); could benefit from this feature: public MyService MyService => Inject();
// and a whole lot of other injections
private T Inject<T>() => ServiceProvider.GetRequiredService(); |
Beta Was this translation helpful? Give feedback.
Answered by
HaloFour
Nov 21, 2024
Replies: 1 comment
-
See: #92 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hillin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: #92