Static members shared amongst instances of closed constructed generic types

Each closed constructed generic type has its own access to static members.

If Class<T> has a static member Value then Class<int> and Class<string> have two separate values for Value.

Indeed, as mentioned in this article about interfaces, there is no diamond operator in C# to access the open generic type underlying to closed types, which prevents generic polymorphism.

How have the same Value for all types or how to have a common static value to simple classes such as Class1 and Class2?

Here is a solution.

Continue reading »


SingletonList generic class preview

Here is a simplified example of a hierarchy based on the latest improvements of the Singleton to create a persistent generic list:

Example of usage: