Eliminating ToList().ForEach() by TDD and Extensions Methods(bengtbe.com)

submitted by bengtbebengtbe(470) 3 years, 2 months ago

Following "Program to an interface, not an implementation", you should use IList instead of List. However, you then lose access to some great delegate methods of the List class (e.g. ForEach, ConvertAll). In order to use them you have to first call ToList(). In this post I will use Test Driven Development (TDD) to add these as extension methods to the generic IEnumerable interface, elimintating the need to call ToList().

add a comment |category: |Views: 133

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story