// // GET: /api/game public IEnumerable<Game> Get(long facebookId, string token) { var context = new WhozitEntities(); var notificationService = new FacebookNotificationService(token); var gamePiecesService = new GamePiecesService(); var gameService = new GameService(context, notificationService, gamePiecesService); return gameService.GetGames(facebookId); }
// // POST: /api/game public void Post(long facebookId, string token) { var context = new WhozitEntities(); var notificationService = new FacebookNotificationService(token); var gamePiecesService = new GamePiecesService(); var gameService = new GameService(context, notificationService, gamePiecesService); var invited = gameService.InviteRandomOpponent(facebookId); if (!invited) //no one was found, throw a not found exception throw new HttpResponseException(new HttpResponseMessage(System.Net.HttpStatusCode.NotFound)); }
public LeaderBoardService(WhozitEntities context) { _context = context; }
// // GET: /LeaderBoard/ public IEnumerable<LeaderBoard> Get() { WhozitEntities context = new WhozitEntities(); ILeaderBoardService leaderBoardService = new LeaderBoardService(context); return leaderBoardService.GetLeaderBoardByPoints(10); }
public GameService(WhozitEntities context, INotificationService notificationService, IGamePiecesService gamePieceService) { _context = context; _notificationService = notificationService; _gamePiecesService = gamePieceService; }
public GamePiecesService(WhozitEntities context) { _context = context; }
public GamePiecesService() { _context = new WhozitEntities(); }