using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace JLHHJSvr.BLL
{
internal abstract class HelperBase
{
///
/// 数据库连接
///
public SqlCommand cmd { get; set; }
///
/// 预留的上下文
///
public Context context { get; set; }
public static T GetHelper(SqlCommand cmd, Context context = null) where T : HelperBase, new()
{
var rslt = new T();
rslt.cmd = cmd;
rslt.context = context ?? new Context();
return rslt;
}
public sealed class Context
{
private DateTime _opdate = DateTime.Now;
public DateTime opdate
{
get { return _opdate; }
set { _opdate = value; }
}
///
/// 用户登陆信息
///
public TokenData tokendata { get; set; }
}
}
}