Skip to content

Instantly share code, notes, and snippets.

@xuanvu
Created September 28, 2012 20:37
Show Gist options
  • Save xuanvu/3801955 to your computer and use it in GitHub Desktop.
Save xuanvu/3801955 to your computer and use it in GitHub Desktop.
Convert multiple lines of condition into 1 single line of LINQ statement
private static bool DoSomething(string name)
{
var result = false;
if(name == "SomeName")
{
result = true;
}
return result;
}
private static bool DoSomething(string name)
{
return name.Equals("SomeName ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment