static void Main(string[] args) { string connectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString; ProjectCLI mainProgram = new ProjectCLI(); mainProgram.RunCLI(); }
static void Main(string[] args) { // getting connection string from the App.Config file string connectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString; ProjectCLI CLI = new ProjectCLI(connectionString); CLI.RunCLI(); }
static void Main(string[] args) { // Sample Code to get a connection string from the // App.Config file // Use this so that you don't need to copy your connection string all over your code! string connectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString; ProjectCLI cli = new ProjectCLI(); cli.RunCLI(); }
static void Main(string[] args) { // Use this so that you don't need to copy your connection string all over your code! // ConfigurationManager opens up the App.config file and looks for an entry called "CapstoneDatabase". // <add name="CapstoneDatabase" connectionString=""/> // The actual connection string for the database is found connectionString attribute. //string connectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString; ProjectCLI cli = new ProjectCLI(); cli.MainParkList(); }
static void Main(string[] args) { // Get the connection string from the appsettings.json file IConfigurationBuilder builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); IConfigurationRoot configuration = builder.Build(); string connectionString = configuration.GetConnectionString("Project"); ICampgroundDAO campgroundDAO = new CampgroundSqlDAO(connectionString); IParkDAO parkDAO = new ParkSqlDAO(connectionString); IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString); ISiteDAO siteDAO = new SiteSqlDAO(connectionString); ProjectCLI projectCLI = new ProjectCLI(campgroundDAO, parkDAO, reservationDAO, siteDAO); projectCLI.RunCLI(); }
public static void Main(string[] args) { ProjectCLI cli = new ProjectCLI(); cli.RunCLI(); }