Example #1
0
 public async Task <List <Locale> > FindLocalesByCoordinates(LocaleQuery query)
 {
     return(await this.databaseContext.Locales
            .Include(query.IncludeZones, locale => locale.Zones)
            .Include(query.IncludePositions, locale => locale.Zones !, zone => zone.Positions !)
            .OrderBy(locale => Math.Pow(locale.Latitude - query.Latitude.GetValueOrDefault(), 2) + Math.Pow(locale.Longitude - query.Longitude.GetValueOrDefault(), 2))
            .Take(5)
            .ToListAsync());
 }
Example #2
0
 public async Task <List <Locale> > GetLocales(LocaleQuery query)
 {
     return(await this.databaseContext.Locales
            .Include(query.IncludeZones, locale => locale.Zones)
            .Include(query.IncludePositions, locale => locale.Zones !, zones => zones.Positions !)
            .Include(query.IncludePositionsCalibrations, locale => locale.Zones !, zones => zones.Positions !, positions => positions.Calibrations !)
            .Include(query.IncludePositionsSignalsData, locale => locale.Zones !, zones => zones.Positions !, positions => positions.PositionSignalData !)
            .ToListAsync());
 }