Created
November 8, 2023 19:59
-
-
Save ahmetkucukoglu/d2ec6f02d8c25f31793579f2a3d98260 to your computer and use it in GitHub Desktop.
Adapter - CsvProductsExporterAdapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CsvProductsExporterAdapter : IProductsExporter | |
{ | |
private CsvHelper CsvHelper { get; set; } | |
public CsvProductsExporterAdapter(CsvHelper csvHelper) | |
{ | |
CsvHelper = csvHelper; | |
} | |
public string Export(List<Product> data) | |
{ | |
return CsvHelper.GenerateCsv(data.Cast<object>().ToList()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment