ZtPictureBll.cs 881 B

12345678910111213141516171819202122232425262728293031323334
  1. using CP.Cache;
  2. using CP.Model;
  3. using MC.ORM;
  4. using MySql.Data.MySqlClient;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace CP.Business
  11. {
  12. public class ZtPictureBll: BaseBll
  13. {
  14. /// <summary>
  15. /// 缓存
  16. /// </summary>
  17. static WMCache cache = WMCache.GetCacheService();
  18. public static List<ZtPicture> GetList()
  19. {
  20. string key = string.Format(CacheKeys.Zt_Picture);
  21. List<ZtPicture> list = cache.GetObject<List<ZtPicture>>(key) as List<ZtPicture>;
  22. if (list == null)
  23. {
  24. var dc = new DataConnect();
  25. list = dc.db.Fetch<ZtPicture>("order by Sort asc");
  26. cache.AddObject(key, list, (int)CacheTime.System);
  27. }
  28. return list;
  29. }
  30. }
  31. }