Skip to content

Instantly share code, notes, and snippets.

@tany3
Created February 27, 2014 07:03
Show Gist options
  • Save tany3/9245655 to your computer and use it in GitHub Desktop.
Save tany3/9245655 to your computer and use it in GitHub Desktop.
重複処理 WhereとFirstOrDefault

##重複処理 WhereとFirstOrDefault - Replace with single call to FirstOrDefault()

###変更前

  collection.where(item => item.Equals(value)).FirstOrDefault();

###変更後

  collection.FirstOrDefault(item => item.Equals(value));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment