Z.EntityFramework.Plus.QueryCache.EF6 Requires QueryDeferred Library?


Question

When trying to use the QueryCache library to do some L2 caching of a few entities, I am receiving a compiler error on .FromCache() indicating the QueryDeferred library is required. Documentation indicates QueryCache can be used as stand-alone.

using Z.EntityFramework.Plus;

namespace LookupValuesMap.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            LookupValueContext ctx = new LookupValueContext();
            var companies = ctx.Companies.FromCache().ToList();  <-- error

Here is the error:

Error   CS0012  The type 'QueryDeferred<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Z.EntityFramework.Plus.QueryDeferred.EF6, Version=1.6.8.0, Culture=neutral, PublicKeyToken=59b66d028979105b'.

Thank you in advance!

J Kent

Expert Answer

Disclaimer: I'm the owner of the project Entity Framework Plus

Due to how the library has been built, some "standalone" features like this one may have the Z.EntityFramework.Plus.QueryDeferred.EF6 requirement.

You can download the version from: NuGet

We will eventually fix it for no longer having to have this dependence.





Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why