Example #1
0
 // get all game
 public IEnumerable <Game> GetAllGames()
 {
     using (var db = new ArcadeContext())
     {
         return(db.ArcadeGames.OrderBy(o => o.Title).ToList());
     }
 }
Example #2
0
        public void Count_Starts_At_Zero()
        {
            var db        = new ArcadeContext();
            var underTest = new ProductRepository(db);

            var count = underTest.Count();

            Assert.Equal(underTest.Count(), count);
        }
Example #3
0
 //get one game
 public IHttpActionResult GetOneGame(int id)
 {
     using (var db = new ArcadeContext())
     {
         var game = db.ArcadeGames.SingleOrDefault(s => s.Id == id);
         if (game == null)
         {
             return(NotFound());
         }
         else
         {
             return(Ok(game));
         }
     }
 }
 public ReviewRepository(ArcadeContext db)
 {
     this.db = db;
 }
Example #5
0
 public ProductRepositoryTests()
 {
     db = new ArcadeContext();
     db.Database.BeginTransaction();
     underTest = new ProductRepository(db);
 }
Example #6
0
 public ProductRepository(ArcadeContext db)
 {
     this.db = db;
 }