i am doing some research about entity data model in asp.net and there is one make me confused.
e.g.
var tombstoneQuery = from t in crnnsupContext.Tombstones
from p in crnnsupContext.ProvStates
where t.RegNumber == _username && t.Province_State == p.ProvinceStateID
select t;
what i want to do is push all the retrieved result into the cache when user login, so it just connect database once.
so i insert tombtoneQuery into Cache. the problem is how i can get the data from the tombstoneQuery, as I know it is a IQueryable object right? so is there a way to execute it?
I have saw someone done this
ObjectResult<Contact> results = (from c in context.Contacts
select c).Execute();
but it poped up an error said IQueryable does not contain a definition for Execute()
anyone can help. much thanks
If you want to execute the query and materialize the results, it sounds like you really want:
… and then put that in your cache.