code_junkie

How do you implement caching in Linq to SQL?

Nov 10th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. var q = from c in context.Customers
  2. where c.City == "London"
  3. select new { c.Name, c.Phone };
  4.  
  5. var result = q.Take(10).FromCache();
  6.  
  7. List<TableItem> myResult = (from t in db.Table select t).ToList();
Add Comment
Please, Sign In to add comment