Inital work on breaking out the core logic out of the MVC API Web App in preparation to migrating to minimal API's in a seperate project

This commit is contained in:
2024-01-13 12:42:46 -08:00
parent 52708bd2c2
commit bdd247e6e0
18 changed files with 91 additions and 32 deletions

View File

@@ -0,0 +1,20 @@
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();
}
}
}