Using IndexedEnumerable in CodeSmith 5.1 - Shannon Davidson - CodeSmith Community - CodeSmith Community
Welcome to the CodeSmith Community!

Using IndexedEnumerable in CodeSmith 5.1

CodeSmith Community

A description has not yet been added to this group.

Using IndexedEnumerable in CodeSmith 5.1

Rate This
  • Comments 1

Let's take a quick look at a new feature in CodeSmith called IndexedEnumerable.  IndexedEnumerable provides a smarter way to iterate collections.  The best way to see this is with a quick sample.  We will get a list of tables and iterate the collection as an indexedenumerable.

A template is attached containing the code you see here.  Run the template against the Petshop Database located in the CodeSmith samples folder, you can see IndexedEnumerable at work.

When you need to know where you are while iterating a collection, Turn your collection into an IndexedEnumerable and it will make life much easier when making decisions based on the index of the current item in the collection.

Attachment: indexedenumerable.cst
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • * Please enter your name
  • * Please enter a comment
  • Post
  • Personal Licenses Available Now CodeSmith is now offering personal licenses for individual developers

Page 1 of 1 (1 items)