Example #1
0
        public void InitialiseDb(DbConfiguration dbConfig, DeploymentConfiguration deployConfig)
        {
            Console.WriteLine("Connecting to the Database...");

            SqlConnection connection = new SqlConnection(dbConfig.GetConnectionString());
            try
            {
                EfDataContext efContext = new EfDataContext(connection);
                if (deployConfig.CreateAdmin)
                {
                    if (string.IsNullOrWhiteSpace(deployConfig.AdminPassword))
                    {
                        Console.WriteLine("An Administrator password was not specified.");
                        Console.WriteLine("Skipping admin creation because of this.");
                    }
                    else
                    {
                        //create an admin user
                    }
                }
            }
            catch(SqlException se)
            {
                Exit(1, "A problem occured whilst querying the Database:\n" + se.Message);
            }

            //more stuff here
        }
Example #2
0
 public Repository(EfDataContext ctx)
 {
     this.ctx = ctx;
 }