public class EnumRouteConstraint : IRouteConstraint
where T : struct
{
private static readonly Lazy> _enumNames; // <
From the JetBrains wiki:
In the vast majority of cases, having a static field in a generic type is a sign of an error. The reason for this is that a static field in a generic type will not be shared among instances of different close constructed types. This means that for a generic class
Cwhich has a static fieldX, the values ofCand.X Chave completely different, independent values..X In the rare cases when you do need the 'specialized' static fields, feel free to suppress the warning.
If you need to have a static field shared between instances with different generic arguments, define a non-generic base class to store your static members, then set your generic type to inherit from this type.