Page MenuHomePhabricator

C#: Create wrapper type with indexers for properties with keys
Open, HighPublic


C# properties using key parameters could use indexers [1] for both getting and setting the property values instead of value tuples. Value tuples should be used only when there are actual multiple values to be set/retrieved.

var someVal = obj.SomeProperty[key];
obj.SomeProperty[key] = someNewVal;

This could be done by creating a new "property wrapper type" that has only the indexers made public.