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(); } } }