VahidN / EFSecondLevelCache.Core

Entity Framework Core Second Level Caching Library
Apache License 2.0
326 stars 51 forks source link

Issue about different linq query #40

Closed iamr8 closed 5 years ago

iamr8 commented 5 years ago

Summary of the issue

after change Where right part of expression, still returns previous value.

Environment

The in-use version:
Operating system: 
IDE: (e.g. Visual Studio 2019)
EF-Core: 2.2.4
AspCore: 2.2.0

Example code/Steps to reproduce:

var query = _items.AsNoTracking()
                .Include(x => x.Property)
            .ThenInclude(x => x.Category);
            query = query.Include(x => x.Property)
            .ThenInclude(x => x.District);
            query = query.Include(x => x.Property)
            .ThenInclude(x => x.Pictures);
            query = query.Include(x => x.Property)
            .ThenInclude(x => x.PropertyFacilities)
            .ThenInclude(x => x.Facility);
            query = query.Include(x => x.Property)
            .ThenInclude(x => x.PropertyFeatures)
            .ThenInclude(x => x.Feature);
            query = query.Include(x => x.Property)
            .ThenInclude(x => x.PropertyOwnerships)
            .ThenInclude(x => x.Ownerships)
            .ThenInclude(x => x.Customer);
            query = query.Include(x => x.Category);
            query = query.Include(x => x.DealRequests);
            query = query.Include(x => x.ItemFeatures)
            .ThenInclude(x => x.Feature);
            query = query.Include(x => x.Applicants)
                .ThenInclude(x => x.Customer);

query = query.Where(x=> x.Id == "123");
var models = await query.Cacheable().ToListAsync().ConfigureAwait(false);

Output:

above code returns things that i wanted. but when i use query.Where(x=> x.Id == "234") instead of query.Where(x=> x.Id == "123") still returns above code's return value.

my suggestion is, in EFDebug's Key, add .Where 's parameteres of left and right of expression

VahidN commented 5 years ago
lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related problems.