Injectio
Injectio copied to clipboard
Abylity to Register keyed service with AnyKey
So its not able to use this cause it's not const. I'm a little confused that the dotnet team decided to use a non-constant value for the key, maybe cause boxing - who knows
[RegisterSingleton(ServiceKey = KeyedService.AnyKey)]
Maybe its possible just to create an enum, and then handle it while source gen, kind of this
public enum ServiceKey { AnyKey }
[RegisterSingleton(ServiceKey = ServiceKey.AnyKey)]
Thought for a while, it's not good to have two members for same stuff ServiceKey.AnyKey and KeyedService.AnyKey will create confusion, maybe better just add simple flag IsAnyKey, default = false, if true it ignores ServiceKey