0
Real life Application of Indexers
Example of app that uses indexers. Or real life application of indexers
1 Respuesta
+ 2
If you have ever used a for loop you have some idea of what an indexer is for an how to use it.
As an example lets say you pull a list of active employees from a database and would like to display data on each of them. Instead of pulling them one by one from the database you would pull a collection and iterate through it in your code.
You do this because if you have 1000 employees its one call vs 1000 calls and you can then take that collection and iterate through it with a for loop or a lambda expression (which does the same thing) to grab the details of each employee at that index and display that data according to your design.