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;
        }
    }

相关文章:

  • 2022-12-23
  • 2021-04-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案