Closed Rayvid closed 4 years ago
AsNoTracking
method will be called on the original query to disable these proxies. We don't need them, because our cache containers only support eager loading of data.Hi, well I'm in the situation getting hands-on on the project already using proxies and i managed to integrate your lib using that not very nice way I have illustrated with a code snippet. Don't you agree if to use Microsoft.EntityFrameworkCore.Proxies - you get detached proxies after Cacheable() call and need to use optionsBuilder.ConfigureWarnings(e => e.Ignore(CoreEventId.DetachedLazyLoadingWarning));
and would be nice to have capability to "autodeproxy" those
Ok never mind, I found EFCore backlog where they plan to introduce conditional proxy creation prevention, I guess that will solve that kind of problems, no need to change this library to support proxies
Summary of the issue
Thanks for a great library, I want to contribute to making it even greater.
I just want to make working with Microsoft.EntityFrameworkCore.Proxies more fluent. At the moment Cacheable appends AsNoTracking on originated query by default and to actually load inner properties when using Cacheable you need to do some magic as I did in a query I have provided as a sample
So the idea would be to add Include and ThenInclude extensions to EFCachedQueryable, what do you think?
And not sure if it's possible, to deproxy Entities automatically? Because if not you need to use
optionsBuilder.ConfigureWarnings(e => e.Ignore(CoreEventId.DetachedLazyLoadingWarning));
to it to workEnvironment
Example code/Steps to reproduce: