Exemple #1
0
 public override void Setup()
 {
     base.Setup();
     dao = new GenresSQLDAO(ConnectionString);
     using (SqlConnection connection = new SqlConnection(ConnectionString))
     {
         connection.Open();
         SqlCommand cmd = connection.CreateCommand();
         cmd.CommandText = @"insert into Genres (genre_id,genre_name) values(10,'Code Fun'),(5,'Code Smash'),(8,'Fun Fun')";
         cmd.ExecuteNonQuery();
     }
 }
 public DataBaseMediator()
 {
     platformsSQLDAO      = new PlatformsSQLDAO(ConnectionString);
     coverSQLDAO          = new CoversSQLDAO(ConnectionString);
     franchiseSQLDAO      = new FranchisesSQLDAO(ConnectionString);
     gameInfoSQLDAO       = new GameInfoSQLDAO(ConnectionString);
     gameRatingSQLDAO     = new GameRatingSQLDAO(ConnectionString);
     genresSQLDAO         = new GenresSQLDAO(ConnectionString);
     userGameInfoSQLDAO   = new UserGameInfoSQLDAO(ConnectionString);
     userLoginSQLDAO      = new UserLoginSqlDao(ConnectionString, hash);
     genresIGDBDAO        = new GenresIGDBDAO(UserApiKey);
     platformsInfoIGDBDAO = new PlatformsIGDBDAO(UserApiKey);
     gameInfoIGDBDAO      = new GameInfoIGDBDAO(UserApiKey, ConnectionString);
     coversIGDBDAO        = new CoversIGDBDAO(UserApiKey);
     franchisesIGDBDAO    = new FranchisesIGDBDAO(UserApiKey);
 }