예제 #1
0
        /// <summary>
        /// Initialize, loading all items from database
        /// </summary>
        public void InitCache()
        {
            _cacheTime = _dao.GetCurrentDate();
            var list = _dao.Query <T>().ToList();

            LoadItems(list);
            _internalCacheTime = DateTime.Now;
            Debug.Print("EntityCache.InitCache : {0:#,##0} Objects of Type {1} cached.", _items.Count, typeof(T).Name);
        }
예제 #2
0
        public void TestFindCustomer()
        {
            var customer = _dao.Query <Customer>()
                           .Where(x => x.Field("LastName").IsEqualTo("Doe"))
                           .And(x => x.Field("FirstName").IsEqualTo("John"))
                           .FirstOrDefault();

            Assert.IsNotNull(customer);
        }
예제 #3
0
 public IQueryable <T> Query()
 {
     return(_dao.Query());
 }