using CP.Cache;
using CP.Model;
using MC.ORM;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CP.Business
{
    public class ZtPictureBll: BaseBll
    {
        /// <summary>
        /// 缓存
        /// </summary>
        static WMCache cache = WMCache.GetCacheService();

        public static List<ZtPicture> GetList()
        {
            string key = string.Format(CacheKeys.Zt_Picture);
            List<ZtPicture> list = cache.GetObject<List<ZtPicture>>(key) as List<ZtPicture>;
            if (list == null)
            {
                var dc = new DataConnect();
                list = dc.db.Fetch<ZtPicture>("order by Sort asc");
                cache.AddObject(key, list, (int)CacheTime.System);
            }
            return list;
        }
    }
}