示例#1
0
        /// <summary>
        /// 返回首列结果
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <returns></returns>
        public TResult ToScalar <TResult>()
        {
            var db     = new DBExtend(__DbContext);
            var result = db.QueryScalar(this);

            if (result == null)
            {
                return(default(TResult));
            }
            return((TResult)result);
        }
示例#2
0
        /// <summary>
        /// 返回首列结果
        /// </summary>
        /// <returns></returns>
        public dynamic ToScalar()
        {
            var db = new DBExtend(__DbContext);

            return(db.QueryScalar(this));
        }