public PersonCollection FetchByID(object ID, bool cached) { if (!cached) { return(FetchByID(ID)); } string cacheKey = (typeof(Person)).ToString() + "-" + ID; Cache cache = HttpRuntime.Cache; if (cache[cacheKey] != null) { return(cache[cacheKey] as PersonCollection); } PersonCollection coll = new PersonCollection().Where(Person.Columns.ID, ID).Load(); cache.Insert(cacheKey, coll, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero); return(coll); }
public PersonCollection FetchByID(object ID) { PersonCollection coll = new PersonCollection().Where("ID", ID).Load(); return(coll); }