| 123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using MySystem.MainModels;
- namespace MySystem
- {
- public class OrdersDbconn
- {
- public readonly static OrdersDbconn Instance = new OrdersDbconn();
- #region 获取单个字段
- public Orders Get(int Id)
- {
- // string key = "Orders:" + Id;
- // if (RedisDbconn.Instance.Exists(key))
- // {
- // Orders obj = RedisDbconn.Instance.Get<Orders>(key);
- // if (obj != null)
- // {
- // return obj;
- // }
- // }
- WebCMSEntities db = new WebCMSEntities();
- Orders order = db.Orders.FirstOrDefault(m => m.Id == Id);
- if (order != null)
- {
- // RedisDbconn.Instance.Set(key, order);
- // RedisDbconn.Instance.SetExpire(key, Library.function.get_Random(1800, 5400));
- }
- db.Dispose();
- return order;
- }
- #endregion
- }
- }
|