20 lines
540 B
C#
20 lines
540 B
C#
using AS1024.GeoFeed.Models;
|
|
using System.Text;
|
|
|
|
namespace AS1024.GeoFeed.Core.Tools
|
|
{
|
|
public static class GeoFeedTools
|
|
{
|
|
public static string ToGeoFeedCsv(this List<IPGeoFeed> geoFeeds)
|
|
{
|
|
StringBuilder csvContent = new();
|
|
|
|
foreach (IPGeoFeed feed in geoFeeds)
|
|
{
|
|
csvContent.AppendLine($"{feed.Prefix},{feed.GeolocCountry},{feed.GeolocRegion},{feed.GeolocCity},{feed.GeolocPostalCode}");
|
|
}
|
|
|
|
return csvContent.ToString();
|
|
}
|
|
}
|
|
} |