Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Allow Usage of Change Tracking To Enable Caching and Attaching of Related Entities From Multiuple Queries #2

Open
bbrandt opened this issue Dec 19, 2019 · 0 comments
Labels
good first issue Good for newcomers

Comments

@bbrandt
Copy link
Contributor

bbrandt commented Dec 19, 2019

Let me know if you think something like this would be useful.

Maybe something like this? Would likely blow up memory usage when many time values used?

public class TimeTravelCacheKeyFactory : IModelCacheKeyFactory
{
    public object Create(DbContext context)
    {
        if (TemporalQuery.TargetDateTime != null)
        {
            return (context.GetType(), TemporalQuery.TargetDateTime);
        }
        return context.GetType();
    }
}

https://docs.microsoft.com/en-us/ef/core/modeling/dynamic-model#imodelcachekeyfactory

@bbrandt bbrandt added the good first issue Good for newcomers label Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant