Resharper and its “Convert to LINQ expression”
I guess im a bit old fashioned, but I like to write code like:
public static List<string> CovertLongListToString(IEnumerable<long> param)
{
List<String> returnList = new List<string>();
foreach (long l in param)
{
returnList.Add(l.ToString());
}
return returnList;
}
But then resharper 5.0 gives me this lovely option of “Convert to LINQ Expression”, and it turns into:
public static List<string> CovertLongListToString(IEnumerable<long> param)
{
return param.Select(l => l.ToString()).ToList();
}
Thats just brilliant! I LOVE YOU RESHARPER!

