Esempio n. 1
0
        public ChoiceHistory RegisterChoiceHistory()
        {
            IList <ScoreBoard> votes      = _voteRepository.GetAllVotesByDateGroupByRestaurantId(DateTime.Now);
            ScoreBoard         scoreBoard = new ScoreBoard();

            scoreBoard.SetMostVoted(votes);
            Restaurant    restaurant    = _restaurantRepository.GetById(scoreBoard.RestaurantId);
            ChoiceHistory choiceHistory = new ChoiceHistory(restaurant, scoreBoard.Draw);

            return(_repository.Add(choiceHistory));
        }
 public void RegisterChoiceHistory()
 {
     ChoiceHistory choiceHistory = _service.RegisterChoiceHistory();
 }
 public void TodaySessionIsOpen()
 {
     ChoiceHistory choiceHistory = _service.GetTodayChoiceHistory();
 }
Esempio n. 4
0
 public ChoiceHistory Add(ChoiceHistory choiceHistory)
 {
     _context.ChoiceHistories.Add(choiceHistory);
     _context.SaveChanges();
     return(choiceHistory);
 }