public IEnumerable<DestinationDto> Known_Destinations(SearchDestinations query)
        {
            RavenQueryStatistics stats;

            var source = Session.Advanced.LuceneQuery<Destination>()
                .Statistics(out stats);

            if (query.Name.IsNotEmpty())
                source = source.WhereEquals("Name", query.Name);

            if(query.HasValidLocation())
                source = source.WithinRadiusOf(10, query.NearBy_Latitude.Value, query.NearBy_Longitude.Value);

            if(query.Address.IsNotEmpty())
                source = source.Search("Address.City", query.Address);

            var results = source.To_DestinationDto().ToList();
            query.TotalResults = stats.TotalResults;
            return results;
        }
Exemple #2
0
 //[PrincipalPermission(SecurityAction.Demand)]
 public IEnumerable<DestinationDto> Known_Destinations(SearchDestinations query)
 {
     return ReadModel.Known_Destinations(query);
 }