Exemple #1
0
        public RestaurantDto GetMoreVoted()
        {
            var restaurants = _restaurantRepository.GetAll();

            var restaurantWereVoted = restaurants.Where(x => x.Votes.Any(y => y.DateTimeVote.Date == DateTime.Now.Date));

            var restaurantMoreVoted = restaurantWereVoted.OrderByDescending(x => x.Votes.Count).FirstOrDefault();

            return(RestaurantDto.ToDto(restaurantMoreVoted));
        }
Exemple #2
0
 public IEnumerable <RestaurantDto> GetAll()
 {
     return(_restaurantRepository.GetAll().Select(x => RestaurantDto.ToDto(x)));
 }