Coder Social home page Coder Social logo

Comments (6)

VahidN avatar VahidN commented on June 18, 2024
  • I have some tests about these included entities here.
  • Also debug this line _cacheServiceProvider.InvalidateCacheDependencies in your code. does changedEntityNames contain your newly changed entity names?
  • At the end you can always force the whole cache to refresh by calling _cacheServiceProvider.ClearAllCachedEntries().

from efsecondlevelcache.core.

szavoda avatar szavoda commented on June 18, 2024

In my Customer -> Phone example above, a change to the Phone entity does not show the Customer Entity in the changedEntityNames variable. I can see in the tests where you are testing for my scenario, however.

I wonder if I have set something up improperly with the entity so that the context does not recognize the relationship.

I want to avoid invalidating the entire cache. Temporarily, I am going to pass an optional parameter to SaveChanges() that will include the additional entities to invalidate the cache for.

from efsecondlevelcache.core.

VahidN avatar VahidN commented on June 18, 2024

Please provide a failing test to study it, something like the mentioned tests.

from efsecondlevelcache.core.

VahidN avatar VahidN commented on June 18, 2024

Tip: EF Core has the ignored includes concept too.
More info

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    optionsBuilder
        .UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=EFQuerying;Trusted_Connection=True;")
        .ConfigureWarnings(warnings => warnings.Throw(CoreEventId.IncludeIgnoredWarning));
}

from efsecondlevelcache.core.

VahidN avatar VahidN commented on June 18, 2024

Tip-2: How to find the detected cache dependencies of a query:

var debugInfo = new EFCacheDebugInfo();
var list = context.Products.Cacheable(debugInfo).ToList();
var cacheDependencies = debugInfo2.EFCacheKey.CacheDependencies;

from efsecondlevelcache.core.

lock avatar lock commented on June 18, 2024

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.

from efsecondlevelcache.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.