You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB
C#

using Microsoft.Extensions.Configuration;
using Common.Library.Settings;
namespace Common.Library.Console.Image.Uploader
{
class Program
{
static void Main(string[] args)
{
SettingsLoader.Configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", true, true)
.Build();
System.Console.Write("Path to Image for Uploading: ");
string pathToFile = System.Console.ReadLine().Replace("\"", string.Empty).Trim();
System.Console.WriteLine();
System.Console.Write("TestimonialID to tie image to: ");
if(int.TryParse(System.Console.ReadLine().Trim(), out int testimonialID) == false)
{
throw new System.Exception("Cannot parse TestimonalID - it is not a number");
}
ImageUploader uploader = new ImageUploader(pathToFile);
uploader.UploadImage(testimonialID);
System.Console.WriteLine("Complete");
System.Console.ReadKey();
}
}
}