Don't cache a queryable. They're lazily evaluated, and the chances are high that (1) the context won't be there when you read the cache, so enumerating it will die, and (2) it isn't serializable, so it won't work with distributed caches.
If you have to cache a list of something, put it into an array of primitive types.
HttpRuntime.Cache["test"] = testObject.ToList(); IList<string> attributes = (IList<string>)Cache["test"];
- How to get object field for LINQ cached object?
- LINQ SQL query check if a object field is not null
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- linq string.contains on field of child object list
- creating Linq to sqlite dbml from DbLinq source code
- Linq to sql as object data source - designer problem with partial classes
- Dictionary from other dictionary grouping by object value field using linq
- Convert this LINQ code back to a Loop (or Why is this object sometimes null)
- convert linq to object query to sql query (no linq to sql code or datacontext)
- Getting the field names from a Linq To Sql object
- check null field in linq new object
- source code for LINQ 101 samples
- Linq code to get the index of an object in an array from an object within a list
- Select object and modify field linq
- Create a tree structure in linq with a single list source with parent - child as strings of an object
- Check Nullable for object insde LinQ to Sql code
- c# Linq or code to extract groups from a single list of source data
- How to update a particular field of a particular object in Generic list in c#.net using LINQ
- Linq access object field
- nullable object must have a value error in linq to sql in vb.net code
- How to use LINQ to select object with minimum or maximum property value
- Deserializing JSON to .NET object using Newtonsoft (or LINQ to JSON maybe?)
- Convert string to int in one line of code using LINQ
- LINQ Group By into a Dictionary Object
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- How can I get LINQ to return the object which has the max value for a given property?
- Can I return the 'id' field after a LINQ insert?
- Create a list from two object lists with linq
- Distinct in Linq based on only one field of the table
- Traversing complex XML document in C# with XLinq
- Inserting a value from a drop down list to UserProfile Table while registering a user
- Permutations of arrays within an array
- How to group one row values in Listview
- Combine two Dictionaries with LINQ
- Select by key from another list in LINQ
- How to join two customer lists into one list
- Retrieve a value from a generic List<T> using LINQ in a foreach statement
- Operator '||' cannot be applied to operands of type 'lambda expression' and 'lambda expression'
- FirstOrDefault() off of a LINQ versus FirstOrDefault() with a Lambda?
- Get unknown amount of parents using LINQ to SQL
- How to extract data from website using AngleSharp & LINQ?
- LINQ To Xml how to generate xml without formatting
- Linq to SQL: Updating dataGridView after SubmitChanges isn't working
- Linq Query, asp.net
- How fast is LINQ?
- how to select value from group by using linq to sql
- C# - All values where ID is 1 from List
- How to do 3 nested group by in linq
- Limit JSON Results