Coffeehouse Post

Single Post Permalink

View Thread: Using reflection, how to tell if a property is an indexer?
  • User profile image
    Richard.Hein

    @BitFlipper: This will work:

     

     Foo f = new Foo();
    var indexers = from property in f.GetType().GetProperties()
    where property.GetIndexParameters().Any()
    select property;
    indexers.Dump();