Class with indexer and property named “Item”

Based on this site, it is possible to use an attribute to rename the Indexer

public class MyClass
{
    public object Item { get; set; }
    [System.Runtime.CompilerServices.IndexerName("MyItem")]
    public object this[string index] { get { return null; } set { } }
}

Leave a Comment