static void Main(string[] args) { // Select all countries //GetAllCountries(); // Get a count of all countries //GetCountryCount(); // Select cities that belong to a country code //GetCitiesForCountryCode("USA"); //Console.ReadKey(); //return; //IConfigurationBuilder builder = new ConfigurationBuilder() // .SetBasePath(Directory.GetCurrentDirectory()) // .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); //IConfigurationRoot configuration = builder.Build(); //string connectionString = configuration.GetConnectionString("World"); ICityDAO cityDAO = null; ICountryDAO countryDAO = new CountrySqlDAO(connectionString); ILanguageDAO languageDAO = null; WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { ICityDAO cityDAO = new CitySqlDAO(@"Server=.\SQLEXPRESS;Database=World;Trusted_Connection=True;"); ICountryDAO countryDAO = new CountrySqlDAO(@"Server=.\SQLExpress;Database=World;Trusted_Connection=True;"); ILanguageDAO languageDAO = new LanguageSqlDAO(@"Server=.\SQLEXPRESS;Database=World;Trusted_Connection=True;"); WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { IConfigurationBuilder builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); IConfigurationRoot configuration = builder.Build(); string connectionString = configuration.GetConnectionString("World"); ICityDAO cityDAO = new CitySqlDAO(connectionString); ICountryDAO countryDAO = new CountrySqlDAO(connectionString); ILanguageDAO languageDAO = new LanguageSqlDAO(connectionString); WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { //IConfigurationBuilder builder = new ConfigurationBuilder() // .SetBasePath(Directory.GetCurrentDirectory()) // .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); //IConfigurationRoot configuration = builder.Build(); //string connectionString = configuration.GetConnectionString("World"); ICityDAO cityDAO = new CitySqlDAO(@"Data Source=.\SQLEXPRESS;Initial Catalog=World;Integrated Security=True"); ICountryDAO countryDAO = new CountrySqlDAO(@"Data Source=.\SQLEXPRESS;Initial Catalog=World;Integrated Security=True"); ILanguageDAO languageDAO = null; WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { //IConfigurationBuilder builder = new ConfigurationBuilder() // .SetBasePath(Directory.GetCurrentDirectory()) // .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); //IConfigurationRoot configuration = builder.Build(); //string connectionString = configuration.GetConnectionString("World"); ICityDAO cityDAO = new CitySqlDAO(@"Server=.\SQLEXPRESS;Database=World;Trusted_Connection=True;"); ICountryDAO countryDAO = new CountrySqlDAO(@"Server=.\SQLEXPRESS;Database=World;Trusted_Connection=True;"); ILanguageDAO languageDAO = new LanguageSqlDAO(@"Server=.\SQLEXPRESS;Database=World;Trusted_Connection=True;"); WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { // Use this as is, it will allow you access to the data in appsettings.json file IConfigurationBuilder builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); IConfigurationRoot configuration = builder.Build(); // Replace world with the key name used for your connection string in the appsettings.json file string connectionString = configuration.GetConnectionString("World"); ICityDAO cityDAO = new CitySqlDAO(connectionString); ICountryDAO countryDAO = null; ILanguageDAO languageDAO = new LanguageSqlDAO(connectionString); WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { // The code in the region reads "appsettings" so that the connection string can: // 1) be in one place in the code // 2) can be modified in the bin/debug.netcoreapp2.1 folder without having to // change and recompile the program #region Get Configuration String IConfigurationBuilder builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); IConfigurationRoot configuration = builder.Build(); string connectionString = configuration.GetConnectionString("World"); #endregion ICityDAO cityDAO = new CitySqlDAO(connectionString); ICountryDAO countryDAO = new CountrySqlDAO(connectionString); ILanguageDAO languageDAO = new LanguageSqlDAO(connectionString); WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO); cli.RunCLI(); }
static void Main(string[] args) { WorldGeographyCLI cli = new WorldGeographyCLI(); cli.RunCLI(); }