partial class DataContext
{
public DateTime GetDate() { return ExecuteQuery<DateTime>("SELECT GETDATE()").First(); }
/// <summary>
/// 获取服务器时间
/// </summary>
/// <returns>时间</returns>
[Function(Name = "GetDate", IsComposable = true)]
public DateTime GetServerDate()
{
MethodInfo mi = MethodBase.GetCurrentMethod() as MethodInfo;
return (DateTime)this.ExecuteMethodCall(this, mi, new object[] { }).ReturnValue;
}
}