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(); }
public ChoiceHistory Add(ChoiceHistory choiceHistory) { _context.ChoiceHistories.Add(choiceHistory); _context.SaveChanges(); return(choiceHistory); }