In C#, what's the syntax for declaring an indexer as part of an interface? Is it still this[ ]? Something feels odd about using the this keyword in an interface.
Asked
Active
Viewed 1,973 times
3 Answers
5
It is - it's pretty odd syntax at other times if you ask me! But it works. You have to declare the get;
and/or set;
parts of it with no definition, just a semi-colon, exactly like ordinary properties in an interface.

Daniel Earwicker
- 114,894
- 38
- 205
- 284