Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created November 7, 2013 10:37
Show Gist options
  • Save csharpforevermore/7352567 to your computer and use it in GitHub Desktop.
Save csharpforevermore/7352567 to your computer and use it in GitHub Desktop.
C# - get a CSV of a property of IEnumerable
public class Car{
public int Id {get; set;}
public string Make {get; set;}
public string Model {get; set;}
}
private string Get
var enumerableCollection = new List<Car>();
...
var identities = string.Join(",", enumerableCollection.Select(o => o.Id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment