Created
          November 12, 2013 23:24 
        
      - 
      
- 
        Save hagbarddenstore/7440684 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void Main() | |
| { | |
| var list = new List<int> { 1, 2, 3, 4, 5, 6 }; | |
| var sumOfAllItems = list.Sum(_ => Print(_)); | |
| Console.WriteLine(sumOfAllItems); | |
| } | |
| static int Print<T>(T item) | |
| { | |
| var s = item.ToString(); | |
| Console.WriteLine(s); | |
| return s.Length; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment