Skip to content

brookpatten/CsvExtensionMethod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

CsvExtensionMethod

Quick extension method to convert an IEnumerable to a csv string

Example Usage

        var people = new List<Person>();
        people.Add(new Person() { FirstName = "Luke", LastName = "Skywalker", Age = 32 });
        people.Add(new Person() { FirstName = "Han", LastName = "Solo" });
        people.Add(new Person() { FirstName = "Leia", LastName = "Organa", Age = 3 });
        people.Add(new Person() { FirstName = "Wedge", LastName = "Antilles", Age = 2 });

        var csv = people.ToCsv("")
            .Column("First", f => f.FirstName)
            .Column("Last", f => f.LastName)
            .Column("Age", f => f.Age)
            .ToString();

About

Quick extension method to convert an IEnumerable to a csv string

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages