using System;
using System.Collections.Generic;
using Library;
using System.Linq;
using MySystem.MainModels;

namespace MySystem
{
    public class UserForMakerCodeDbconn
    {
        public readonly static UserForMakerCodeDbconn Instance = new UserForMakerCodeDbconn();

        #region 获取单个字段
        public UserForMakerCode Get(string MakerCode)
        {
            // string key = "UserForMakerCode:" + MakerCode;
            // if (RedisDbconn.Instance.Exists(key))
            // {
            //     UserForMakerCode obj = RedisDbconn.Instance.Get<UserForMakerCode>(key);
            //     if (obj != null)
            //     {
            //         return obj;
            //     }
            // }
            WebCMSEntities db = new WebCMSEntities();
            UserForMakerCode order = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode);
            if (order != null)
            {
                // RedisDbconn.Instance.Set(key, order);
                // RedisDbconn.Instance.SetExpire(key, Library.function.get_Random(1800, 5400));
            }
            db.Dispose();
            return order;
        }
        #endregion

    }
}
