EntityFramework ToListAsync() funktioniert nicht

Ich versuche zu nennen, EF-Methode ToListAsync. Aber nichts passierte - keine Ausnahme, kein timeout läuft.

Dies ist mein code.

        private IQueryable<Place> placeCompleteQuery;
    protected IQueryable<Place> PlaceCompleteQuery
    {
        get
        {
            return this.placeCompleteQuery ?? (this.placeCompleteQuery = this.Context.Places.Include(p => p.Address).
                Include(p => p.CreatedBy).
                Include(p => p.Source).
                Include(p => p.Type.Translations).
                Include(p => p.Ratings));
        }
    }

    public async Task<IList<Place>> GetPlacesByLocationAsync(DbGeography location, int radius)
    {
        List<Place> temporaryResult = PlaceCompleteQuery.Where(p => p.Location.Distance(location) <= radius).
            ToList();

        return await PlaceCompleteQuery.Where(p => p.Location.Distance(location) <= radius).
            ToListAsync();
    }

Den ersten sync-Aufruf von ToList-Methode return Ergebnis sofort. Die zweite async call of ToListAsync läuft noch kein Ergebnis noch die Ausnahme.

Irgendwelche Vorschläge?

InformationsquelleAutor Martin Majoroš | 2014-02-25

Schreibe einen Kommentar