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)); }
public IEnumerable <RestaurantDto> GetAll() { return(_restaurantRepository.GetAll().Select(x => RestaurantDto.ToDto(x))); }