how to save a dictionary as a csv file in csharp

Code Example - how to save a dictionary as a csv file in csharp

                
                        String csv = String.Join(
    Environment.NewLine,
    data.Select(d => %%%~COMPRESS~PRE~0~%%%quot;{d.Key};{d.Value};")
);
System.IO.File.WriteAllText(pathToCsv, csv);