root/UnityWeb/UnityWeb/Repository/NHibernateDataAccess/Providers/ProductDataProvider.cs

5556
22
22
23
        #region Implementation of IProductDataProvider
23
        #region Implementation of IProductDataProvider
24
24
25
        public IList<Product> GetProducts()
25
        IList<Product> IProductDataProvider.GetProducts()
26
        {
26
        {
27
            _session.Flush();
27
            _session.Flush();
28
            return _session.CreateCriteria(typeof (Product)).List<Product>();
28
            return _session.CreateCriteria(typeof (Product))
29
                .SetCacheable(true)
30
                .SetCacheMode(CacheMode.Normal)
31
                .List<Product>();
29
        }
32
        }
30
33
34
        Product IProductDataProvider.GetProduct(int id)
35
        {
36
            _session.Flush();
37
            return _session.Get<Product>(id);
38
        }
39
31
        #endregion
40
        #endregion
32
    }
41
    }
33
}
42
}