Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

	 
var db = new TrackerDataContext();

// cache for 120 seconds
CacheSettings cache = new CacheSettings(120);

// build up queries
var q1 = db.User
    .ByEmailAddress("one@test.com")
    .FutureCache(cache);
    
var q2 = db.Task
     .Where(t => t.Summary == "Test")
    .FutureCache(cache);

// this triggers the loading of all the future queries
var users = q1.ToList();

...

Does not support anonymous types.

Next: LINQ to SQL Profiler